Skip to content

Commit

Permalink
Minor PEP8 sanity fixes (Ansible 2.16)
Browse files Browse the repository at this point in the history
  • Loading branch information
tremble committed Nov 10, 2023
1 parent d448727 commit df26e0b
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 72 deletions.
62 changes: 0 additions & 62 deletions .github/workflows/sanity.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,65 +8,3 @@ jobs:
uses: ansible-network/github_actions/.github/workflows/sanity.yml@main
with:
matrix_include: "[]"
matrix_exclude: >-
[
{
"ansible-version": "stable-2.9"
},
{
"ansible-version": "stable-2.12",
"python-version": "3.7"
},
{
"ansible-version": "stable-2.12",
"python-version": "3.11"
},
{
"ansible-version": "stable-2.13",
"python-version": "3.7"
},
{
"ansible-version": "stable-2.13",
"python-version": "3.11"
},
{
"ansible-version": "stable-2.14",
"python-version": "3.7"
},
{
"ansible-version": "stable-2.14",
"python-version": "3.8"
},
{
"ansible-version": "stable-2.15",
"python-version": "3.7"
},
{
"ansible-version": "stable-2.15",
"python-version": "3.8"
},
{
"ansible-version": "milestone",
"python-version": "3.7"
},
{
"ansible-version": "milestone",
"python-version": "3.8"
},
{
"ansible-version": "milestone",
"python-version": "3.9"
},
{
"ansible-version": "devel",
"python-version": "3.7"
},
{
"ansible-version": "devel",
"python-version": "3.8"
},
{
"ansible-version": "devel",
"python-version": "3.9"
}
]
3 changes: 3 additions & 0 deletions changelogs/fragments/20231110-sanity.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
minor_changes:
- autoscaling_group - minor PEP8 whitespace sanity fixes ().
- rds_instance_snapshot - minor PEP8 whitespace sanity fixes ().
18 changes: 9 additions & 9 deletions plugins/modules/autoscaling_group.py
Original file line number Diff line number Diff line change
Expand Up @@ -1675,15 +1675,15 @@ def get_instances_by_launch_config(props, lc_check, initial_instances):
old_instances.append(i)

else:
module.debug(f"Comparing initial instances with current: {*initial_instances,}")
module.debug(f"Comparing initial instances with current: {*initial_instances, }")
for i in props["instances"]:
if i not in initial_instances:
new_instances.append(i)
else:
old_instances.append(i)

module.debug(f"New instances: {len(new_instances)}, {*new_instances,}")
module.debug(f"Old instances: {len(old_instances)}, {*old_instances,}")
module.debug(f"New instances: {len(new_instances)}, {*new_instances, }")
module.debug(f"Old instances: {len(old_instances)}, {*old_instances, }")

return new_instances, old_instances

Expand All @@ -1702,15 +1702,15 @@ def get_instances_by_launch_template(props, lt_check, initial_instances):
else:
old_instances.append(i)
else:
module.debug(f"Comparing initial instances with current: {*initial_instances,}")
module.debug(f"Comparing initial instances with current: {*initial_instances, }")
for i in props["instances"]:
if i not in initial_instances:
new_instances.append(i)
else:
old_instances.append(i)

module.debug(f"New instances: {len(new_instances)}, {*new_instances,}")
module.debug(f"Old instances: {len(old_instances)}, {*old_instances,}")
module.debug(f"New instances: {len(new_instances)}, {*new_instances, }")
module.debug(f"Old instances: {len(old_instances)}, {*old_instances, }")

return new_instances, old_instances

Expand Down Expand Up @@ -1775,9 +1775,9 @@ def terminate_batch(connection, replace_instances, initial_instances, leftovers=
instances_to_terminate = list_purgeable_instances(props, lc_check, lt_check, replace_instances, initial_instances)

module.debug(f"new instances needed: {num_new_inst_needed}")
module.debug(f"new instances: {*new_instances,}")
module.debug(f"old instances: {*old_instances,}")
module.debug(f"batch instances: {*instances_to_terminate,}")
module.debug(f"new instances: {*new_instances, }")
module.debug(f"old instances: {*old_instances, }")
module.debug(f"batch instances: {*instances_to_terminate, }")

if num_new_inst_needed == 0:
decrement_capacity = True
Expand Down
2 changes: 1 addition & 1 deletion plugins/modules/rds_instance_snapshot.py
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ def get_parameters(parameters, method_name):
required_options = get_boto3_client_method_parameters(client, method_name, required=True)
if any(parameters.get(k) is None for k in required_options):
method_description = get_rds_method_attribute(method_name, module).operation_description
module.fail_json(msg=f"To {method_description} requires the parameters: {*required_options,}")
module.fail_json(msg=f"To {method_description} requires the parameters: {*required_options, }")
options = get_boto3_client_method_parameters(client, method_name)
parameters = dict((k, v) for k, v in parameters.items() if k in options and v is not None)

Expand Down

0 comments on commit df26e0b

Please sign in to comment.