-
Notifications
You must be signed in to change notification settings - Fork 50
dcnm_bootflash: IT: update switchX to switch_X #584
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
base: develop
Are you sure you want to change the base?
Conversation
This commit updates the following vars in all dcnm_bootflash integration tests: switch1 -> switch_1 switch2 -> switch_2 We are standardizing on switch_X going forward for all ansible-dcnm integration tests.
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.
Pull request overview
This PR updates variable naming in dcnm_bootflash integration tests to standardize switch references from switch1/switch2 to switch_1/switch_2. The changes apply to documentation comments, IP address variable references, and dictionary key accesses across four test files.
Key Changes:
- Updated IP address variable references from
{{ switch1 }}and{{ switch2 }}to{{ switch_1 }}and{{ switch_2 }} - Updated dictionary key accesses in assertions from
switch1/switch2toswitch_1/switch_2 - Updated documentation comments to reference the new naming convention
Issue Identified:
The PR partially implements the standardized naming convention. While it updates the main switch variables and dictionary keys, it does not update related compound variables like switch1_file1, switch1_filepath1, switch2_file1, etc. to switch_1_file1, switch_1_filepath1, switch_2_file1, etc. This creates an inconsistent naming pattern where some variables use underscores and others don't. Complete consistency would require also updating the variable definitions in defaults/main.yaml.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 6 comments.
| File | Description |
|---|---|
| tests/integration/targets/dcnm_bootflash/tests/dcnm_bootflash_query_wildcard.yaml | Updates switch variable references in comments, config, and assertions from switch1/switch2 to switch_1/switch_2 |
| tests/integration/targets/dcnm_bootflash/tests/dcnm_bootflash_query_specific.yaml | Updates switch variable references in comments, config, and assertions from switch1/switch2 to switch_1/switch_2 |
| tests/integration/targets/dcnm_bootflash/tests/dcnm_bootflash_deleted_wildcard.yaml | Updates switch variable references in comments, config, and assertions from switch1/switch2 to switch_1/switch_2 |
| tests/integration/targets/dcnm_bootflash/tests/dcnm_bootflash_deleted_specific.yaml | Updates switch variable references in comments, config, and assertions from switch1/switch2 to switch_1/switch_2 |
Comments suppressed due to low confidence (2)
tests/integration/targets/dcnm_bootflash/tests/dcnm_bootflash_deleted_specific.yaml:219
- Inconsistent variable naming: While the IP address variable has been updated to
{{ switch_2 }}, the file variables in the filepath templates still use the old naming convention (switch2_file1,switch2_file2, etc.). For consistency with the standardized naming, these should be updated toswitch_2_file1,switch_2_file2,switch_2_file3,switch_2_file4. This also requires updating the variable definitions indefaults/main.yaml.
- filepath: "bootflash:/{{ switch2_file1 }}"
supervisor: active
- filepath: "bootflash:/{{ switch2_file2 }}"
supervisor: active
- filepath: "bootflash:/{{ switch2_file3 }}"
supervisor: active
- filepath: "bootflash:/{{ switch2_file4 }}"
tests/integration/targets/dcnm_bootflash/tests/dcnm_bootflash_query_specific.yaml:236
- Inconsistent variable naming: While the IP address variables have been updated to
{{ switch_2 }}, the file variables in the filepath templates still use the old naming convention (switch2_file2,switch2_file3, etc.). For consistency with the standardized naming, these should be updated toswitch_2_file2,switch_2_file3,switch_2_file4. This also requires updating the variable definitions indefaults/main.yaml.
- filepath: "bootflash:/{{ switch2_file2 }}"
supervisor: active
- filepath: "bootflash:/{{ switch2_file3 }}"
supervisor: active
- filepath: "bootflash:/{{ switch2_file4 }}"
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| - result.diff[0][switch_1][0].filepath == switch1_filepath1 | ||
| - result.diff[0][switch_1][1].filepath == switch1_filepath2 | ||
| - result.diff[0][switch_1][2].filepath == switch1_filepath3 | ||
| - result.diff[0][switch_2][0].filepath == switch2_filepath1 | ||
| - result.diff[0][switch_2][1].filepath == switch2_filepath2 | ||
| - result.diff[0][switch_2][2].filepath == switch2_filepath3 |
Copilot
AI
Dec 9, 2025
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.
Inconsistent variable naming: While the dictionary keys have been correctly updated to switch_1 and switch_2, the comparison variables still use the old naming convention (switch1_filepath1, switch1_filepath2, etc.). For consistency with the standardized naming, consider updating these to switch_1_filepath1, switch_1_filepath2, etc. This would also require updating the variable definitions in defaults/main.yaml and the set_fact task above.
| - result.diff[0][switch_1][0].filepath == switch1_filepath1 | ||
| - result.diff[0][switch_1][1].filepath == switch1_filepath2 | ||
| - result.diff[0][switch_1][2].filepath == switch1_filepath3 | ||
| - result.diff[0][switch_2][0].filepath == switch2_filepath1 | ||
| - result.diff[0][switch_2][1].filepath == switch2_filepath2 | ||
| - result.diff[0][switch_2][2].filepath == switch2_filepath3 |
Copilot
AI
Dec 9, 2025
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.
Inconsistent variable naming: While the dictionary keys have been correctly updated to switch_1 and switch_2, the comparison variables still use the old naming convention (switch1_filepath1, switch1_filepath2, etc.). For consistency with the standardized naming, consider updating these to switch_1_filepath1, switch_1_filepath2, etc. This would also require updating the variable definitions in defaults/main.yaml and the set_fact task above.
| - result.diff[0][switch_1][0].filepath == switch1_filepath1 | ||
| - result.diff[0][switch_1][1].filepath == switch1_filepath2 | ||
| - result.diff[0][switch_1][2].filepath == switch1_filepath3 | ||
| - result.diff[0][switch_1][3].filepath == switch1_filepath4 | ||
| - result.diff[0][switch_2][0].filepath == switch2_filepath1 | ||
| - result.diff[0][switch_2][1].filepath == switch2_filepath2 | ||
| - result.diff[0][switch_2][2].filepath == switch2_filepath3 | ||
| - result.diff[0][switch_2][3].filepath == switch2_filepath4 |
Copilot
AI
Dec 9, 2025
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.
Inconsistent variable naming: While the dictionary keys have been correctly updated to switch_1 and switch_2, the comparison variables still use the old naming convention (switch1_filepath1, switch1_filepath2, etc.). For consistency with the standardized naming, consider updating these to switch_1_filepath1, switch_1_filepath2, etc. This would also require updating the variable definitions in defaults/main.yaml and the set_fact task above.
| - result.diff[0][switch_1][0].filepath == switch1_filepath1 | ||
| - result.diff[0][switch_1][1].filepath == switch1_filepath2 | ||
| - result.diff[0][switch_1][2].filepath == switch1_filepath3 | ||
| - result.diff[0][switch_2][0].filepath == switch2_filepath1 | ||
| - result.diff[0][switch_2][1].filepath == switch2_filepath2 | ||
| - result.diff[0][switch_2][2].filepath == switch2_filepath3 |
Copilot
AI
Dec 9, 2025
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.
Inconsistent variable naming: While the dictionary keys have been correctly updated to switch_1 and switch_2, the comparison variables still use the old naming convention (switch1_filepath1, switch1_filepath2, etc.). For consistency with the standardized naming, consider updating these to switch_1_filepath1, switch_1_filepath2, etc. This would also require updating the variable definitions in defaults/main.yaml and the set_fact task above.
| - filepath: "bootflash:/{{ switch1_file2 }}" | ||
| supervisor: active | ||
| - filepath: "bootflash:/{{ switch1_file3 }}" | ||
| supervisor: active | ||
| - filepath: "bootflash:/{{ switch1_file4 }}" |
Copilot
AI
Dec 9, 2025
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.
Inconsistent variable naming: While the IP address variables have been updated to {{ switch_1 }} and {{ switch_2 }}, the file variables in the filepath templates still use the old naming convention (switch1_file2, switch1_file3, etc.). For consistency with the standardized naming, these should be updated to switch_1_file2, switch_1_file3, switch_1_file4. This also requires updating the variable definitions in defaults/main.yaml.
This PR updates the following vars in all dcnm_bootflash integration tests to align with standardized switch naming.
switch1 -> switch_1
switch2 -> switch_2