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

NIOS_ZONE type object is changed when run with --check #214

Open
mkearey opened this issue Jan 29, 2024 · 0 comments · May be fixed by #215
Open

NIOS_ZONE type object is changed when run with --check #214

mkearey opened this issue Jan 29, 2024 · 0 comments · May be fixed by #215

Comments

@mkearey
Copy link

mkearey commented Jan 29, 2024

The module goes ahead and changes attributes in a zone when the --check option is set.

The plugins/modules/nios_zone.py has :

"notes:
- This module supports C(check_mode).
"

But there is no logic around the section where NIOS_ZONE is handled in plugins/module_utils/api.py to test that --check is defined - It just runs the object update:

"
if (ib_obj_type in (NIOS_ZONE)):
# popping 'zone_format' key as update of 'zone_format' is not supported with respect to zone_auth
proposed_object = self.on_update(proposed_object, ib_spec)
del proposed_object['zone_format']
self.update_object(ref, proposed_object)
result['changed'] = True
"

This can be fixed with:

"
if (ib_obj_type in (NIOS_ZONE)):
# popping 'zone_format' key as update of 'zone_format' is not supported with respect to zone_auth
proposed_object = self.on_update(proposed_object, ib_spec)
del proposed_object['zone_format']
if not self.module.check_mode:
res = self.update_object(ref, proposed_object)
result['changed'] = True
"

If I figure out how to create the pull req and submit a patch I will, and update here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant