Pure-Storage-Ansible / FlashArray-Collection

Ansible Collection for Pure Storage FlashArray
GNU General Public License v3.0
19 stars 21 forks source link

Param enabled not work in purefa_pgsched #504

Closed tpeponas closed 7 months ago

tpeponas commented 7 months ago

Describe the bug Module parameter "enabled" not work when is set to false in the module purefa_pgsched. This parameter is interpreted as boolean , so condition in code:

_if not module.params["enabled"]: snap_enabled = current_snap["snap_enabled"] else: snapenabled = module.params["enabled"]

the condition if not module.params["enabled"] is true when module.params["enabled"] is false, and so pg sched does not change.

This code works to check if parameter "enabled" is defined or not

_if module.params["enabled"] is None: snap_enabled = current_snap["snap_enabled"] else: snapenabled = module.params["enabled"]

Exemple To Reproduce

Regards, Thomas

sdodsley commented 7 months ago

@tpeponas you have set schedule: replication therefore the code doesn't even get into the section where snap_enabled is mentioned. I'll have a look at this to see what is going on.

tpeponas commented 7 months ago

you right but same problem with code : _if not module.params["enabled"]: replicate_enabled = current_repl["replicate_enabled"] else: replicateenabled = module.params["enabled"]