From 93d61a76cb81342c4ef743b7bce28e6132120288 Mon Sep 17 00:00:00 2001 From: James Holland <6574404+jamesholland-uk@users.noreply.github.com> Date: Fri, 8 Sep 2023 09:22:59 +0100 Subject: [PATCH] fix(panos_device_group): Do not move a Device Group if state is set to gathered (#484) --- plugins/modules/panos_device_group.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/plugins/modules/panos_device_group.py b/plugins/modules/panos_device_group.py index 03e3b0f98..3a6307a2a 100644 --- a/plugins/modules/panos_device_group.py +++ b/plugins/modules/panos_device_group.py @@ -112,7 +112,11 @@ def post_state_handling(self, obj, result, module): else: parent = module.params["parent"] result["diff"]["after_parent"] = parent - if obj.opstate.dg_hierarchy.parent != parent: + if obj.opstate.dg_hierarchy.parent != parent and module.params["state"] in ( + "present", + "replaced", + "merged", + ): result["changed"] = True obj.opstate.dg_hierarchy.parent = parent if not module.check_mode: