nautobot / nautobot-app-golden-config

Golden Configuration App for Nautobot.
https://docs.nautobot.com/projects/golden-config/en/latest/
Other
100 stars 56 forks source link

'NoneType' object has no attribute 'strftime' #48

Closed jdrew82 closed 3 years ago

jdrew82 commented 3 years ago

Environment

Steps to Reproduce

  1. Install Golden Config plugin.
  2. Setup git repositories for backup and intended. Do NOT setup templates.
  3. Run compliance job.
  4. Go to devices that succeed.
  5. Click on icon for Compliance in Configuration Types box.

Expected Behavior

See configuration status.

Observed Behavior

Get a stack trace:

Environment:

Request Method: GET Request URL: http://localhost:8000/plugins/golden-config/config-details/device_name/compliance/

Django Version: 3.1.8 Python Version: 3.7.10 Installed Applications: ['django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', 'django.contrib.humanize', 'cacheops', 'corsheaders', 'django_filters', 'django_tables2', 'django_prometheus', 'mptt', 'rest_framework', 'social_django', 'taggit', 'timezone_field', 'nautobot.core', 'nautobot.circuits', 'nautobot.dcim', 'nautobot.ipam', 'nautobot.extras', 'nautobot.tenancy', 'nautobot.users', 'nautobot.utilities', 'nautobot.virtualization', 'django_rq', 'drf_yasg', 'graphene_django', 'baxter_nautobot_api.NautobotAPIConfig', 'baxter_nautobot_common_utils.NautobotCommonUtilsConfig', 'baxter_netbox_netbuild.NautobotNetbuildConfig', 'baxter_nautobot_jobs.BaxterNautobotJobsConfig', 'nautobot_device_onboarding.OnboardingConfig', 'nautobot_plugin_nornir.NornirConfig', 'nautobot_golden_config.GoldenConfiguration'] Installed Middleware: ['django_prometheus.middleware.PrometheusBeforeMiddleware', 'corsheaders.middleware.CorsMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.common.CommonMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware', 'django.middleware.security.SecurityMiddleware', 'nautobot.core.middleware.ExceptionHandlingMiddleware', 'nautobot.core.middleware.RemoteUserMiddleware', 'nautobot.core.middleware.ExternalAuthMiddleware', 'nautobot.core.middleware.APIVersionMiddleware', 'nautobot.core.middleware.ObjectChangeMiddleware', 'django_prometheus.middleware.PrometheusAfterMiddleware']

Traceback (most recent call last): File "/usr/local/lib/python3.7/site-packages/django/core/handlers/exception.py", line 47, in inner response = get_response(request) File "/usr/local/lib/python3.7/site-packages/django/core/handlers/base.py", line 181, in _get_response response = wrapped_callback(request, *callback_args, callback_kwargs) File "/usr/local/lib/python3.7/site-packages/django/views/generic/base.py", line 70, in view return self.dispatch(request, *args, *kwargs) File "/usr/local/lib/python3.7/site-packages/nautobot/utilities/views.py", line 47, in dispatch return super().dispatch(request, args, kwargs) File "/usr/local/lib/python3.7/site-packages/django/views/generic/base.py", line 98, in dispatch return handler(request, *args, **kwargs) File "/usr/local/lib/python3.7/site-packages/nautobot_golden_config/views.py", line 104, in get backup_date = str(config_details.backup_last_success_date.strftime("%b %d %Y"))

Exception Type: AttributeError at /plugins/golden-config/config-details/device_name/compliance/ Exception Value: 'NoneType' object has no attribute 'strftime'

jdrew82 commented 3 years ago

This has been resolved.