-
Notifications
You must be signed in to change notification settings - Fork 236
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix(eos_config_deploy_cvp): avoid making CV_DEVICES becoming None #1300
Fix(eos_config_deploy_cvp): avoid making CV_DEVICES becoming None #1300
Conversation
ansible_collections/arista/avd/roles/eos_config_deploy_cvp/templates/cvp-devices-v3.j2
Outdated
Show resolved
Hide resolved
ansible_collections/arista/avd/roles/eos_config_deploy_cvp/templates/cvp-devices-v3.j2
Outdated
Show resolved
Hide resolved
ansible_collections/arista/avd/roles/eos_config_deploy_cvp/templates/cvp-devices-v3.j2
Outdated
Show resolved
Hide resolved
ansible_collections/arista/avd/roles/eos_config_deploy_cvp/templates/cvp-devices-v3.j2
Show resolved
Hide resolved
ansible_collections/arista/avd/roles/eos_config_deploy_cvp/templates/cvp-devices-v3.j2
Outdated
Show resolved
Hide resolved
Minor spacing changes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Dismissing, since we will rework this to add error messages in case of no devices matched by the filter.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM - we don't need an error message, since it is not necessarily an error that no devices where ready to be deployed. So we will just parse the empty list along to the cvp modules and they will return without any action being done.
… devices
Change Summary
Related Issue(s)
Fixes #
Component(s) name
arista.avd.eos_config_deploy_cvp
Proposed changes
in https://github.com/aristanetworks/ansible-avd/blob/devel/ansible_collections/arista/avd/roles/eos_config_deploy_cvp/templates/cvp-devices-v3.j2
if the device_filter does not match any devices inside the for loop
CVP_DEVICES
will be empty, so it'll becomeNone
and then on the ansible-cvp side we'll get that TypeError traceback mentioned in the #1293This will only set
CVP_DEVICES
to an empty list, and then validation should be done in the cv_devices_v3 module on ansible-cvp sideHow to test
To check if the list will become empty simply print the
CVP_DEVICES
var in https://github.com/aristanetworks/ansible-avd/blob/devel/ansible_collections/arista/avd/roles/eos_config_deploy_cvp/tasks/v3/present.yml after L41like this:
which should result in
Checklist
User Checklist
Repository Checklist