diff --git a/changelogs/fragments/20240919-fix_sanity.yml b/changelogs/fragments/20240919-fix_sanity.yml new file mode 100644 index 00000000000..ae45638f926 --- /dev/null +++ b/changelogs/fragments/20240919-fix_sanity.yml @@ -0,0 +1,2 @@ +trivial: + - "Fix sanity errors happening with the ansible devel branch (e.g., unreachable code, using variable before assignment)." diff --git a/plugins/modules/ec2_vpc_vgw.py b/plugins/modules/ec2_vpc_vgw.py index 1b2af15a5ab..b6f91e5dfc1 100644 --- a/plugins/modules/ec2_vpc_vgw.py +++ b/plugins/modules/ec2_vpc_vgw.py @@ -420,6 +420,7 @@ def ensure_vgw_absent(client, module): changed = False params = dict() result = dict() + deleted_vgw = None params["Name"] = module.params.get("name") params["VpcId"] = module.params.get("vpc_id") params["Type"] = module.params.get("type") diff --git a/plugins/modules/ecs_cluster.py b/plugins/modules/ecs_cluster.py index 5a0470eea8e..0500a27ffdb 100644 --- a/plugins/modules/ecs_cluster.py +++ b/plugins/modules/ecs_cluster.py @@ -339,7 +339,7 @@ def main(): elif module.params["state"] == "has_instances": if not existing: module.fail_json(msg="Cluster '" + module.params["name"] + " not found.") - return + # it exists, so we should delete it and mark changed. # return info about the cluster deleted delay = module.params["delay"] @@ -361,7 +361,6 @@ def main(): + str(delay) + " seconds each." ) - return module.exit_json(**results) diff --git a/plugins/modules/ecs_service.py b/plugins/modules/ecs_service.py index e6ecf736b5c..be2735cf6da 100644 --- a/plugins/modules/ecs_service.py +++ b/plugins/modules/ecs_service.py @@ -1248,7 +1248,7 @@ def main(): elif module.params["state"] == "deleting": if not existing: module.fail_json(msg="Service '" + module.params["name"] + " not found.") - return + # it exists, so we should delete it and mark changed. # return info about the cluster deleted delay = module.params["delay"] @@ -1263,7 +1263,6 @@ def main(): time.sleep(delay) if i is repeat - 1: module.fail_json(msg=f"Service still not deleted after {repeat} tries of {delay} seconds each.") - return module.exit_json(**results)