From c1b9ec071dd36dd956ff6d9ffd04db48b77be9bd Mon Sep 17 00:00:00 2001 From: "ricardo.bartels@telekom.de" Date: Thu, 24 Nov 2022 23:12:06 +0100 Subject: [PATCH] adds config option to define where the cache files should be stored #254 --- module/netbox/connection.py | 3 ++- settings-example.ini | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/module/netbox/connection.py b/module/netbox/connection.py index 433eab8..aaa1253 100644 --- a/module/netbox/connection.py +++ b/module/netbox/connection.py @@ -49,6 +49,7 @@ class NetBoxHandler: "timeout": 30, "max_retry_attempts": 4, "use_caching": True, + "cache_directory_location": "cache", "ignore_unknown_source_object_pruning": False } @@ -126,7 +127,7 @@ class NetBoxHandler: if self.use_caching is False: return - cache_folder_name = "cache" + cache_folder_name = self.cache_directory_location base_dir = os.sep.join(__file__.split(os.sep)[0:-3]) if cache_folder_name[0] != os.sep: diff --git a/settings-example.ini b/settings-example.ini index 62e733d..56620b9 100644 --- a/settings-example.ini +++ b/settings-example.ini @@ -102,6 +102,9 @@ host_fqdn = netbox.example.com # dependencies occur, switching off caching might help. #use_caching = true +# The location of the directory where the cache files should be stored +#cache_directory_location = cache + ### ### [sources/*] ###