From 5408cf5af0a7be8c05596e64655cab6374f81dfd Mon Sep 17 00:00:00 2001 From: Marc Leuser Date: Sun, 7 May 2023 21:23:10 +0200 Subject: [PATCH 1/2] rename JOBRESULT_RETENTION to JOB_RETENTION --- configuration/configuration.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/configuration/configuration.py b/configuration/configuration.py index 5185735..3e50aaf 100644 --- a/configuration/configuration.py +++ b/configuration/configuration.py @@ -141,8 +141,11 @@ if 'CHANGELOG_RETENTION' in environ: CHANGELOG_RETENTION = _environ_get_and_map('CHANGELOG_RETENTION', None, _AS_INT) # Maximum number of days to retain job results (scripts and reports). Set to 0 to retain job results in the database indefinitely. (Default: 90) -if 'JOBRESULT_RETENTION' in environ: - JOBRESULT_RETENTION = _environ_get_and_map('JOBRESULT_RETENTION', None, _AS_INT) +if 'JOB_RETENTION' in environ: + JOB_RETENTION = _environ_get_and_map('JOB_RETENTION', None, _AS_INT) +# JOBRESULT_RETENTION was renamed to JOB_RETENTION in the v3.5.0 release of NetBox. For backwards compatibility, map JOBRESULT_RETENTION to JOB_RETENTION +else if 'JOBRESULT_RETENTION' in environ: + JOB_RETENTION = _environ_get_and_map('JOBRESULT_RETENTION', None, _AS_INT) # API Cross-Origin Resource Sharing (CORS) settings. If CORS_ORIGIN_ALLOW_ALL is set to True, all origins will be # allowed. Otherwise, define a list of allowed origins using either CORS_ORIGIN_WHITELIST or From 055538cc21b782d767af144f2919dff0b9f4aab0 Mon Sep 17 00:00:00 2001 From: Tobias Genannt Date: Mon, 8 May 2023 17:44:09 +0200 Subject: [PATCH 2/2] Fixed type in else --- configuration/configuration.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configuration/configuration.py b/configuration/configuration.py index 3e50aaf..18c55dd 100644 --- a/configuration/configuration.py +++ b/configuration/configuration.py @@ -144,7 +144,7 @@ if 'CHANGELOG_RETENTION' in environ: if 'JOB_RETENTION' in environ: JOB_RETENTION = _environ_get_and_map('JOB_RETENTION', None, _AS_INT) # JOBRESULT_RETENTION was renamed to JOB_RETENTION in the v3.5.0 release of NetBox. For backwards compatibility, map JOBRESULT_RETENTION to JOB_RETENTION -else if 'JOBRESULT_RETENTION' in environ: +elif 'JOBRESULT_RETENTION' in environ: JOB_RETENTION = _environ_get_and_map('JOBRESULT_RETENTION', None, _AS_INT) # API Cross-Origin Resource Sharing (CORS) settings. If CORS_ORIGIN_ALLOW_ALL is set to True, all origins will be