Skip to content

Commit

Permalink
Fix sanity errors happening with the ansible devel branch (#2146)
Browse files Browse the repository at this point in the history
SUMMARY

Fix sanity errors happening with the ansible devel branch
ERROR: Found 5 pylint issue(s) which need to be resolved:
ERROR: plugins/modules/ec2_vpc_vgw.py:504:13: used-before-assignment: Using variable 'deleted_vgw' before assignment
ERROR: plugins/modules/ecs_cluster.py:342:12: unreachable: Unreachable code
ERROR: plugins/modules/ecs_cluster.py:364:12: unreachable: Unreachable code
ERROR: plugins/modules/ecs_service.py:1251:12: unreachable: Unreachable code
ERROR: plugins/modules/ecs_service.py:1266:12: unreachable: Unreachable code


ISSUE TYPE


Bugfix Pull Request
Docs Pull Request
Feature Pull Request
New Module Pull Request

COMPONENT NAME

ADDITIONAL INFORMATION

Reviewed-by: Bikouo Aubin
  • Loading branch information
alinabuzachis authored Sep 20, 2024
1 parent 2470237 commit 008b515
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
2 changes: 2 additions & 0 deletions changelogs/fragments/20240919-fix_sanity.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
trivial:
- "Fix sanity errors happening with the ansible devel branch (e.g., unreachable code, using variable before assignment)."
1 change: 1 addition & 0 deletions plugins/modules/ec2_vpc_vgw.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
3 changes: 1 addition & 2 deletions plugins/modules/ecs_cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand All @@ -361,7 +361,6 @@ def main():
+ str(delay)
+ " seconds each."
)
return

module.exit_json(**results)

Expand Down
3 changes: 1 addition & 2 deletions plugins/modules/ecs_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand All @@ -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)

Expand Down

0 comments on commit 008b515

Please sign in to comment.