nautobot/nautobot-app-golden-config

Device filtering in jobs wrongly matches excluded devices when GC dynamic group uses child groups

johanek opened this issue · 2 comments

Environment

  • Python version: 3.8.10
  • Nautobot version: 1.6.2
  • nautobot-golden-config version: 1.6.4

Expected Behavior

Devices which are not part of the golden config dynamic group are not matched when running golden config jobs (generate intended config, run config compliance)

Observed Behavior

They are included

Steps to Reproduce

I have a golden config dynamic group which has two child groups - a dynamic group of included hosts, and a dynamic group of devices tagged with "disable-compliance-checks" which are excluded. The list of members in the UI is correct according to this logic. The idea behind this is to disable config compliance on the "specials".

The dynamic group logic looks something like this:

(
  device_role__slug='customer-router' AND platform__slug='juniper_junos' AND (
    NOT (tags__slug='disable-compliance-checks')
  )
)

When running an intended config generation or config compliance job, the excluded devices are matched (and generate errors in my case).

In fact when trying to run intended config generation for any device - even one not matching the include dynamic group - nautobot will try and generate the config for the device.

Does it show correctly in the dynamic group definition itself?

Does it show correctly in the dynamic group definition itself?

Yes, the list of members in the UI is correct