nautobot-app-golden-config
nautobot-app-golden-config copied to clipboard
Duplicate GC entries for devices when platform changes
Environment
- Python version: 3.9.6
- Nautobot version: 1.3.7 and 1.4.2
- nautobot-golden-config version: 1.1.3 and 1.2.0
Steps to Reproduce
- Set up Nautobot with 2 platforms: IOS and IOS-XE
- Set up at least 1 Golden Config features and rules for both platforms.
- Create a device using platform IOS
- Run all 3 Golden Config jobs for the device (backup, intended, compliance)
- In Nautobot, go to Golden Config --> Configuration Compliance. Select the device.
- At the top of the page, note the red/green boxes showing "compliant/non-compliant" for each feature. There should be one box for each IOS feature configured.
- Change the assigned platform to the device from IOS to IOS-XE
- Rerun all 3 Golden Config jobs (from step 4)
- Go back to the Configuration Compliance page, and select the same device again
- At the top of the page, you will now see twice as many red/green boxes. One box for each IOS feature, and another box for each IOS-XE feature.
Expected Behavior
After changing the platform on a device (like from IOS to IOS-XE), all of the golden config objects should be dropped from the old platform.
Observed Behavior
The data from the original platform remains, and is only removed when I delete the config compliance data from a device and rerun the compliance job.
This causes duplicate features to be reported for a device that has changed platforms (until it can be manually deleted and the compliance job reran).
This also skews the Compliance Reporting numbers, where each device with double-platform data shows double numbers in the report.
Can you confirm:
- This is not a dynamic group issue
- This is not a caching issue
e.g. if you go to dynamic group after you make such a change, do you see the same issues? If so, can you open an issue with Core.
Notice DNS is twice (as well as other features)
Will have to fix it here: https://github.com/nautobot/nautobot-plugin-golden-config/blob/fa4c7c2407187a6eac79855e90ef736fc4e4968c/nautobot_golden_config/models.py#L321
Can you confirm:
- This is not a dynamic group issue
- This is not a caching issue
e.g. if you go to dynamic group after you make such a change, do you see the same issues? If so, can you open an issue with Core.
I don't believe this has anything to do with Dynamic Groups. I am seeing this on devices setup when no dynamic groups are configured in Nautobot.
I also don't believe it's a caching issue, as it occurs even in a new/incognito browser. As for it being a CacheOps issue, usually those go away when a modification is made to the relevant database table (see Nautobot issue #1627 for details). So I don't believe it's cacheops related, but am not certain.