Skip to content

Commit

Permalink
ansible-collections#1573 fix more pep8 errors
Browse files Browse the repository at this point in the history
  • Loading branch information
mikehas committed Oct 27, 2022
1 parent 705d3fa commit 298adb0
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions plugins/modules/ssm_parameter.py
Original file line number Diff line number Diff line change
Expand Up @@ -392,21 +392,21 @@ def update_parameter_tags(client, module, parameter_name, supplied_tags):
response = {}

if supplied_tags is None:
return False, response
return False, response

current_tags = get_parameter_tags(client, module, parameter_name)[0]
tags_to_add, tags_to_remove = compare_aws_tags(current_tags, supplied_tags,
module.params.get('purge_tags'))

if tags_to_add:
if module.check_mode:
return True, response
return True, response
response = tag_parameter(client, module, parameter_name,
ansible_dict_to_boto3_tag_list(tags_to_add))
changed = True
if tags_to_remove:
if module.check_mode:
return True, response
return True, response
response = untag_parameter(client, module, parameter_name, tags_to_remove)
changed = True

Expand All @@ -422,8 +422,8 @@ def update_parameter(client, module, **args):
try:
response = client.put_parameter(aws_retry=True, **args)
changed = True
except (botocore.exceptions.ClientError, botocore.exceptions.BotoCoreError) as e:
module.fail_json_aws(e, msg="setting parameter")
except (botocore.exceptions.ClientError, botocore.exceptions.BotoCoreError) as exc:
module.fail_json_aws(exc, msg="setting parameter")

return changed, response

Expand Down Expand Up @@ -508,18 +508,18 @@ def create_update_parameter(client, module):

# Handle tag updates for existing parameters
if (module.params.get('overwrite_value') != 'never'):
tags_changed, tags_response = update_parameter_tags(client, module,
existing_parameter['Parameter']['Name'], module.params.get('tags'))
tags_changed, tags_response = update_parameter_tags(
client, module, existing_parameter['Parameter']['Name'],
module.params.get('tags'))

changed = changed or tags_changed

if tags_response:
response['tag_updates'] = tags_response


else:
# Add tags in initial creation request
if (module.params.get('tags')):
if module.params.get('tags'):
args.update(Tags=ansible_dict_to_boto3_tag_list(module.params.get('tags')))
# Overwrite=True conflicts with tags and is not needed for new param
args.update(Overwrite=False)
Expand Down

0 comments on commit 298adb0

Please sign in to comment.