Fix(eos_config_deploy_cvp): device_filter is not behaving correctly if input is a string #3046
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Change Summary
In AVD 4.0, the move to use v3 of CVP collection by default broke the integration with inventory_to_container module in some cases.
With v1 tasks, if a string was given as
device_filter
, it was converted to the list[<string>]
by the v1 tasks. This is not the case anymore.This leads to some misleading result in particular with the empty string device_filter
""
Additionally, while this has been transparent to the user, if a string like "DC1" was given as device_filter, the
inventory_to_container
action was actually comparing the hostnames to"D"
,"C"
and"1"
, potentially leading to bad filtering. For instance if you had DC1 and DC2 devices and wanted to generate CVP config only for DC1 it would have failed and selecting also the device from DC2 because they have "D" or "C" in their name.Related Issue(s)
Reported internally
Component(s) name
arista.avd.eos_config_deploy_cvp
Proposed changes
Add a step in the
inventory_to_container
action plugin to convert a string"a"
to a list["a"]
by defaultHow to test
Added a molecule scenario.
First commit shows output before the fix, second commit shows after the fix the difference (notice the parentContainers are back and so are devices - yeah!)
Checklist
Repository Checklist