ISSUE TYPE
SOFTWARE VERSIONS
pynautobot
3.0.0
Ansible:
2.18.11
Nautobot:
2.0.0
Collection:
networktocode.nautobot v6.0.0
SUMMARY
If a user defines a custom graphql query for devices -> platform but does not include "napalm_driver" as a value, the add_ansible_platform method fails to add the napalm driver as it checks for the existence of the napalm_driver key in the platform dictionary.
STEPS TO REPRODUCE
In your inventory file, create a graphql option like so:
query:
devices:
filters:
has_primary_ip: true
platform:
name:
primary_ip4:
host:
Then, run your inventory sync. You'll notice that the ansible_network_os variable does not get assigned to the hosts.
EXPECTED RESULTS
I'd expect for the code to merge the needed napalm_driver into the query as it is part of the base query
ACTUAL RESULTS
My definition of platform overrides the base_query entirely resulting in the loss of the napalm_driver key
ISSUE TYPE
SOFTWARE VERSIONS
pynautobot
3.0.0
Ansible:
2.18.11
Nautobot:
2.0.0
Collection:
networktocode.nautobot v6.0.0
SUMMARY
If a user defines a custom graphql query for
devices -> platformbut does not include "napalm_driver" as a value, theadd_ansible_platformmethod fails to add the napalm driver as it checks for the existence of thenapalm_driverkey in the platform dictionary.STEPS TO REPRODUCE
In your inventory file, create a graphql option like so:
Then, run your inventory sync. You'll notice that the
ansible_network_osvariable does not get assigned to the hosts.EXPECTED RESULTS
I'd expect for the code to merge the needed
napalm_driverinto the query as it is part of the base queryACTUAL RESULTS
My definition of
platformoverrides thebase_queryentirely resulting in the loss of thenapalm_driverkey