diff --git a/netbox/extras/scripts.py b/netbox/extras/scripts.py index ea8c75df1..b20e7e170 100644 --- a/netbox/extras/scripts.py +++ b/netbox/extras/scripts.py @@ -560,12 +560,6 @@ class BaseScript: # Convenience functions # - def get_storage(self): - if self.storage is None: - self.storage = storages.create_storage(storages.backends["scripts"]) - - return self.storage - def load_yaml(self, filename): """ Return data from a YAML file @@ -575,9 +569,8 @@ class BaseScript: except ImportError: from yaml import Loader - storage = self.get_storage() file_path = os.path.join(settings.SCRIPTS_ROOT, filename) - with storage.open(file_path, 'r') as datafile: + with open(file_path, 'r') as datafile: data = yaml.load(datafile, Loader=Loader) return data @@ -586,10 +579,8 @@ class BaseScript: """ Return data from a JSON file """ - - storage = self.get_storage() file_path = os.path.join(settings.SCRIPTS_ROOT, filename) - with storage.open(file_path, 'r') as datafile: + with open(file_path, 'r') as datafile: data = json.load(datafile) return data