Skip to content

Commit

Permalink
Backport Linting cleanup from 1181 (#1219)
Browse files Browse the repository at this point in the history
Backport Linting cleanup from 1181

Partial backport of #1181
SUMMARY
Minor linting cleanup

missing whitespace

ISSUE TYPE
Feature Pull Request
COMPONENT NAME
plugins/inventory/aws_ec2.py
plugins/modules/s3_object_info.py
ADDITIONAL INFORMATION
Original Reviews:
Reviewed-by: Alina Buzachis
Reviewed-by: Gonéri Le Bouder

Reviewed-by: Alina Buzachis <None>
  • Loading branch information
tremble authored Oct 28, 2022
1 parent f432b5d commit ff97b24
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 deletions.
3 changes: 3 additions & 0 deletions changelogs/fragments/1181-stable-5-linting.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
minor_changes:
- aws_ec2 inventory - minor linting fixes (https://github.com/ansible-collections/amazon.aws/pull/1181).
- s3_object_info - minor linting fixes (https://github.com/ansible-collections/amazon.aws/pull/1181).
2 changes: 1 addition & 1 deletion plugins/inventory/aws_ec2.py
Original file line number Diff line number Diff line change
Expand Up @@ -737,7 +737,7 @@ def prepare_host_vars(cls, original_host_vars, hostvars_prefix=None, hostvars_su

if hostvars_prefix or hostvars_suffix:
for hostvar, hostval in host_vars.copy().items():
del(host_vars[hostvar])
del host_vars[hostvar]
if hostvars_prefix:
hostvar = hostvars_prefix + hostvar
if hostvars_suffix:
Expand Down
14 changes: 7 additions & 7 deletions plugins/modules/s3_object_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -466,7 +466,7 @@ def describe_s3_object_acl(connection, bucket_name, object_name):

if len(object_acl_info) != 0:
# Remove ResponseMetadata from object_acl_info, convert to snake_case
del(object_acl_info['ResponseMetadata'])
del object_acl_info['ResponseMetadata']
object_acl_info = camel_dict_to_snake_dict(object_acl_info)

return object_acl_info
Expand All @@ -487,7 +487,7 @@ def describe_s3_object_attributes(connection, module, bucket_name, object_name):

if len(object_attributes_info) != 0 and 'msg' not in object_attributes_info.keys():
# Remove ResponseMetadata from object_attributes_info, convert to snake_case
del(object_attributes_info['ResponseMetadata'])
del object_attributes_info['ResponseMetadata']
object_attributes_info = camel_dict_to_snake_dict(object_attributes_info)

return object_attributes_info
Expand All @@ -507,7 +507,7 @@ def describe_s3_object_legal_hold(connection, bucket_name, object_name):

if len(object_legal_hold_info) != 0:
# Remove ResponseMetadata from object_legal_hold_info, convert to snake_case
del(object_legal_hold_info['ResponseMetadata'])
del object_legal_hold_info['ResponseMetadata']
object_legal_hold_info = camel_dict_to_snake_dict(object_legal_hold_info)

return object_legal_hold_info
Expand All @@ -526,7 +526,7 @@ def describe_s3_object_lock_configuration(connection, bucket_name):

if len(object_legal_lock_configuration_info) != 0:
# Remove ResponseMetadata from object_legal_lock_configuration_info, convert to snake_case
del(object_legal_lock_configuration_info['ResponseMetadata'])
del object_legal_lock_configuration_info['ResponseMetadata']
object_legal_lock_configuration_info = camel_dict_to_snake_dict(object_legal_lock_configuration_info)

return object_legal_lock_configuration_info
Expand All @@ -546,7 +546,7 @@ def describe_s3_object_retention(connection, bucket_name, object_name):

if len(object_retention_info) != 0:
# Remove ResponseMetadata from object_retention_info, convert to snake_case
del(object_retention_info['ResponseMetadata'])
del object_retention_info['ResponseMetadata']
object_retention_info = camel_dict_to_snake_dict(object_retention_info)

return object_retention_info
Expand All @@ -566,7 +566,7 @@ def describe_s3_object_tagging(connection, bucket_name, object_name):

if len(object_tagging_info) != 0:
# Remove ResponseMetadata from object_tagging_info, convert to snake_case
del(object_tagging_info['ResponseMetadata'])
del object_tagging_info['ResponseMetadata']
object_tagging_info = boto3_tag_list_to_ansible_dict(object_tagging_info['TagSet'])

return object_tagging_info
Expand Down Expand Up @@ -622,7 +622,7 @@ def get_object(connection, bucket_name, object_name):

if len(object_info) != 0:
# Remove ResponseMetadata from object_info, convert to snake_case
del(object_info['ResponseMetadata'])
del object_info['ResponseMetadata']
object_info = camel_dict_to_snake_dict(object_info)

result['object_data'] = object_info
Expand Down

0 comments on commit ff97b24

Please sign in to comment.