Skip to content
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

[minor_change] add all attributes to mo output for check_mode delete #446

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion plugins/module_utils/aci.py
Original file line number Diff line number Diff line change
Expand Up @@ -1657,7 +1657,9 @@ def dump_json(self):

elif self.params.get("state") == "absent" and self.existing:
for aci_class in self.existing[0]:
mo[aci_class] = dict(attributes=dict(dn=dn_path, status="deleted"))
attributes = deepcopy(self.existing[0][aci_class]["attributes"])
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to include all the attributes or will just name do?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change is still to be decided because it is actually a NDI issue (bug already identified).

However if we do decide to make changes name will likely not be suffice. I think the identifier of the class is required by NDI, triggering the error of name for name attribute. But other classes can have different identifiers, thus I think more attributes should be exposed. Since we don't keep track of these identifier attributes we either expose all ( generic few lines of code ) or need to make changes per module to add the identifier attributes to the mo output.

attributes["status"] = "deleted"
mo[aci_class] = dict(attributes=attributes)

self.result["mo"] = mo
output_path = self.params.get("output_path")
Expand Down