nautobot-app-ssot
nautobot-app-ssot copied to clipboard
Jobs fail on Nautobot v1.4+ due to missing interface status field
Environment
- Python version: 3.7.15
- Nautobot version: 1.5.4
- nautobot-ssot-aci version: 1.0.0
Expected Behavior
Nautobot versions 1.4 and above require an interface status to be set when an interface is created. When running the plugin on Nautobot v1.4 or above the interface status pulled from ACI should be populated in the 'status' field. Alternatively a default value for 'status' should be set for all populated interfaces based on a plugin variable set in nautobot_config.py
Observed Behavior
When populating the database the job will fail with the following error
Traceback (most recent call last): File "/usr/local/lib/python3.7/site-packages/nautobot_ssot/jobs/base.py", line 332, in run self.sync_data() File "/usr/local/lib/python3.7/site-packages/nautobot_ssot/jobs/base.py", line 167, in sync_data self.execute_sync() File "/usr/local/lib/python3.7/site-packages/nautobot_ssot/jobs/base.py", line 95, in execute_sync self.source_adapter.sync_to(self.target_adapter, flags=self.diffsync_flags) File "/usr/local/lib/python3.7/site-packages/diffsync/__init__.py", line 579, in sync_to target.sync_from(self, diff_class=diff_class, flags=flags, callback=callback, diff=diff) File "/usr/local/lib/python3.7/site-packages/diffsync/__init__.py", line 557, in sync_from result = syncer.perform_sync() File "/usr/local/lib/python3.7/site-packages/diffsync/helpers.py", line 327, in perform_sync changed |= self.sync_diff_element(element) File "/usr/local/lib/python3.7/site-packages/diffsync/helpers.py", line 367, in sync_diff_element changed, modified_model = self.sync_model(src_model=src_model, dst_model=dst_model, ids=ids, attrs=attrs) File "/usr/local/lib/python3.7/site-packages/diffsync/helpers.py", line 416, in sync_model dst_model = self.model_class.create(diffsync=self.dst_diffsync, ids=ids, attrs=attrs) File "/usr/local/lib/python3.7/site-packages/nautobot_ssot_aci/diffsync/models/nautobot.py", line 281, in create _interface.validated_save() File "/usr/local/lib/python3.7/site-packages/nautobot/core/models/__init__.py", line 51, in validated_save self.full_clean() File "/usr/local/lib/python3.7/site-packages/django/db/models/base.py", line 1251, in full_clean raise ValidationError(errors) django.core.exceptions.ValidationError: {'status': ['This field cannot be blank.']}
Steps to Reproduce
- Be on Nautobot version 1.4+
- Install nautobot_ssot_aci plugin
- Define ACI environment via ENV vars
- Run job (not dry-run) against an ACI environment