-
Notifications
You must be signed in to change notification settings - Fork 2
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
Swim bug fixed - An image cannot be tagged as golden with multiple device roles #27
Swim bug fixed - An image cannot be tagged as golden with multiple device roles #27
Conversation
…talyst-center-ansible-intg into swim_workflow_feature_enhansment
description: | | ||
Specifies the device role(s) for tagging or untagging the image as golden. | ||
Permissible values: | ||
- `ALL`: Applies the golden tag to all devices, regardless of role. |
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.
Use ' instead of `
- 'ALL': Tags all devices as golden, regardless of role.
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.
updated the code
Specifies the device role(s) for tagging or untagging the image as golden. | ||
Permissible values: | ||
- `ALL`: Applies the golden tag to all devices, regardless of role. | ||
- `UNKNOWN`: For devices without a specific classification. |
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.
Tags devices without a specified classification.
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.
updated the code
Permissible values: | ||
- `ALL`: Applies the golden tag to all devices, regardless of role. | ||
- `UNKNOWN`: For devices without a specific classification. | ||
- `ACCESS`: Devices connecting end-user devices (e.g., access switches). |
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.
Tags devices that connect end-user devices (e.g., access switches).
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.
updated the code
- `ALL`: Applies the golden tag to all devices, regardless of role. | ||
- `UNKNOWN`: For devices without a specific classification. | ||
- `ACCESS`: Devices connecting end-user devices (e.g., access switches). | ||
- `BORDER ROUTER`: Devices linking different network segments or domains. |
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.
- 'BORDER ROUTER': Tags devices linking different network segments or domains.
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.
updated the code
- `UNKNOWN`: For devices without a specific classification. | ||
- `ACCESS`: Devices connecting end-user devices (e.g., access switches). | ||
- `BORDER ROUTER`: Devices linking different network segments or domains. | ||
- `DISTRIBUTION`: Devices aggregating traffic towards the core. |
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.
- 'DISTRIBUTION': Tags devices aggregating traffic toward the core.
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.
updated the code
self.log(tag_image_golden) | ||
|
||
if image_status == tag_image_golden: | ||
self.log("inside if") |
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.
remove this log, not useful one
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.
updated the code
self.log(msg, "INFO") | ||
already_tagged_device_role.append(role) | ||
|
||
if not image_status and image_status == tag_image_golden: |
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.
this should be elif since you have already checked image_status as tag_image_golden in 1584 a
elif not image_status and not tag_image_golden:
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.
updated the code
4c45cc6
into
cisco-en-programmability:main
Description
problem: An image cannot be tagged as golden with multiple device roles
Solution: To allow an image to be tagged as golden for multiple device roles, I implemented a loop structure that iterates through each specified device role in the list and applies the golden tag accordingly. The loop ensures that each device role specified will be processed, tagging the image as golden for all applicable roles without requiring multiple separate executions. This approach helps to streamline the tagging process, making it more efficient and adaptable for various configurations.
The loop verifies each device role before tagging to ensure compatibility and avoid errors. If the image is not already tagged for a particular role, the loop adds the tag, ensuring that no redundant tags are applied. This solution not only enhances code efficiency but also improves scalability, allowing future expansion to accommodate more device roles or additional tagging criteria with minimal adjustments.
Type of Change
Checklist
Ansible Best Practices
ansible-vault
or environment variables)Documentation
Screenshots (if applicable)
Notes to Reviewers