Skip to content

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

@mkearey

Description

@mkearey

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions