From 44b45b4c462ab712bf7aa76a910f3bcb42022a84 Mon Sep 17 00:00:00 2001 From: Jeff Kala Date: Thu, 29 Aug 2024 09:28:28 -0500 Subject: [PATCH 1/3] fix caches db instance to 1 which is the proper default as 0 is used for celery broker --- .../development/nautobot_config.py | 2 +- .../development/nautobot_config.py | 2 +- .../development/nautobot_config.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) mode change 100644 => 100755 nautobot-app-ssot/{{ cookiecutter.project_slug }}/development/nautobot_config.py diff --git a/nautobot-app-chatops/{{ cookiecutter.project_slug }}/development/nautobot_config.py b/nautobot-app-chatops/{{ cookiecutter.project_slug }}/development/nautobot_config.py index bbba03c3..01fa1ee2 100644 --- a/nautobot-app-chatops/{{ cookiecutter.project_slug }}/development/nautobot_config.py +++ b/nautobot-app-chatops/{{ cookiecutter.project_slug }}/development/nautobot_config.py @@ -67,7 +67,7 @@ CACHES = { "default": { "BACKEND": "django_redis.cache.RedisCache", - "LOCATION": parse_redis_connection(redis_database=0), + "LOCATION": parse_redis_connection(redis_database=1), "TIMEOUT": 300, "OPTIONS": { "CLIENT_CLASS": "django_redis.client.DefaultClient", diff --git a/nautobot-app-ssot/{{ cookiecutter.project_slug }}/development/nautobot_config.py b/nautobot-app-ssot/{{ cookiecutter.project_slug }}/development/nautobot_config.py old mode 100644 new mode 100755 index a0feccf5..7861d311 --- a/nautobot-app-ssot/{{ cookiecutter.project_slug }}/development/nautobot_config.py +++ b/nautobot-app-ssot/{{ cookiecutter.project_slug }}/development/nautobot_config.py @@ -67,7 +67,7 @@ CACHES = { "default": { "BACKEND": "django_redis.cache.RedisCache", - "LOCATION": parse_redis_connection(redis_database=0), + "LOCATION": parse_redis_connection(redis_database=1), "TIMEOUT": 300, "OPTIONS": { "CLIENT_CLASS": "django_redis.client.DefaultClient", diff --git a/nautobot-app/{{ cookiecutter.project_slug }}/development/nautobot_config.py b/nautobot-app/{{ cookiecutter.project_slug }}/development/nautobot_config.py index 60c5cfbd..c121f731 100644 --- a/nautobot-app/{{ cookiecutter.project_slug }}/development/nautobot_config.py +++ b/nautobot-app/{{ cookiecutter.project_slug }}/development/nautobot_config.py @@ -67,7 +67,7 @@ CACHES = { "default": { "BACKEND": "django_redis.cache.RedisCache", - "LOCATION": parse_redis_connection(redis_database=0), + "LOCATION": parse_redis_connection(redis_database=1), "TIMEOUT": 300, "OPTIONS": { "CLIENT_CLASS": "django_redis.client.DefaultClient", From d0bbfc9b2871db4549c6918893bc50fd20a0b2d2 Mon Sep 17 00:00:00 2001 From: Jeff Kala Date: Thu, 29 Aug 2024 14:35:17 -0500 Subject: [PATCH 2/3] code review updates --- .../development/nautobot_config.py | 17 +++-------------- .../development/nautobot_config.py | 17 +++-------------- .../development/nautobot_config.py | 14 +++----------- 3 files changed, 9 insertions(+), 39 deletions(-) diff --git a/nautobot-app-chatops/{{ cookiecutter.project_slug }}/development/nautobot_config.py b/nautobot-app-chatops/{{ cookiecutter.project_slug }}/development/nautobot_config.py index 01fa1ee2..e7a0018b 100644 --- a/nautobot-app-chatops/{{ cookiecutter.project_slug }}/development/nautobot_config.py +++ b/nautobot-app-chatops/{{ cookiecutter.project_slug }}/development/nautobot_config.py @@ -4,7 +4,7 @@ import sys from nautobot.core.settings import * # noqa: F403 # pylint: disable=wildcard-import,unused-wildcard-import -from nautobot.core.settings_funcs import is_truthy, parse_redis_connection +from nautobot.core.settings_funcs import is_truthy # # Debug @@ -64,19 +64,8 @@ # # The django-redis cache is used to establish concurrent locks using Redis. -CACHES = { - "default": { - "BACKEND": "django_redis.cache.RedisCache", - "LOCATION": parse_redis_connection(redis_database=1), - "TIMEOUT": 300, - "OPTIONS": { - "CLIENT_CLASS": "django_redis.client.DefaultClient", - }, - } -} - -# Redis Cacheops -CACHEOPS_REDIS = parse_redis_connection(redis_database=1) +# Inherited from nautobot.core.settings +# CACHES = {....} # # Celery settings are not defined here because they can be overloaded with diff --git a/nautobot-app-ssot/{{ cookiecutter.project_slug }}/development/nautobot_config.py b/nautobot-app-ssot/{{ cookiecutter.project_slug }}/development/nautobot_config.py index 7861d311..75706a63 100755 --- a/nautobot-app-ssot/{{ cookiecutter.project_slug }}/development/nautobot_config.py +++ b/nautobot-app-ssot/{{ cookiecutter.project_slug }}/development/nautobot_config.py @@ -4,7 +4,7 @@ import sys from nautobot.core.settings import * # noqa: F403 # pylint: disable=wildcard-import,unused-wildcard-import -from nautobot.core.settings_funcs import is_truthy, parse_redis_connection +from nautobot.core.settings_funcs import is_truthy # # Debug @@ -64,19 +64,8 @@ # # The django-redis cache is used to establish concurrent locks using Redis. -CACHES = { - "default": { - "BACKEND": "django_redis.cache.RedisCache", - "LOCATION": parse_redis_connection(redis_database=1), - "TIMEOUT": 300, - "OPTIONS": { - "CLIENT_CLASS": "django_redis.client.DefaultClient", - }, - } -} - -# Redis Cacheops -CACHEOPS_REDIS = parse_redis_connection(redis_database=1) +# Inherited from nautobot.core.settings +# CACHES = {....} # # Celery settings are not defined here because they can be overloaded with diff --git a/nautobot-app/{{ cookiecutter.project_slug }}/development/nautobot_config.py b/nautobot-app/{{ cookiecutter.project_slug }}/development/nautobot_config.py index c121f731..33af3238 100644 --- a/nautobot-app/{{ cookiecutter.project_slug }}/development/nautobot_config.py +++ b/nautobot-app/{{ cookiecutter.project_slug }}/development/nautobot_config.py @@ -4,7 +4,7 @@ import sys from nautobot.core.settings import * # noqa: F403 # pylint: disable=wildcard-import,unused-wildcard-import -from nautobot.core.settings_funcs import is_truthy, parse_redis_connection +from nautobot.core.settings_funcs import is_truthy # # Debug @@ -64,16 +64,8 @@ # # The django-redis cache is used to establish concurrent locks using Redis. -CACHES = { - "default": { - "BACKEND": "django_redis.cache.RedisCache", - "LOCATION": parse_redis_connection(redis_database=1), - "TIMEOUT": 300, - "OPTIONS": { - "CLIENT_CLASS": "django_redis.client.DefaultClient", - }, - } -} +# Inherited from nautobot.core.settings +# CACHES = {....} # # Celery settings are not defined here because they can be overloaded with From edd7aa251c3b097ea3498150b3233f62ae418200 Mon Sep 17 00:00:00 2001 From: Gary Snider <75227981+gsnider2195@users.noreply.github.com> Date: Thu, 17 Oct 2024 08:21:48 -0700 Subject: [PATCH 3/3] fix executable bit --- .../development/nautobot_config.py | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100755 => 100644 nautobot-app-ssot/{{ cookiecutter.project_slug }}/development/nautobot_config.py diff --git a/nautobot-app-ssot/{{ cookiecutter.project_slug }}/development/nautobot_config.py b/nautobot-app-ssot/{{ cookiecutter.project_slug }}/development/nautobot_config.py old mode 100755 new mode 100644