Skip to content

Commit

Permalink
chore: clean up whitespace and remove debug statements
Browse files Browse the repository at this point in the history
  • Loading branch information
shblue21 committed Sep 20, 2023
1 parent 412c889 commit 22e8b6b
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions plugins/modules/codedeploy_deployment_group.py
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@
- DEPLOYMENT_FAILURE
ec2_tag_set:
ec2_tag_set_list:
- ec2_tag:
- ec2_tag:
- key: Name
value: ec2_instance_1
type: KEY_AND_VALUE
Expand Down Expand Up @@ -367,7 +367,7 @@
type: KEY_AND_VALUE
state: present
# Delete a codedeploy group
- codedeploy_deployment_group:
application_name: codedeploy-app
Expand Down Expand Up @@ -499,8 +499,6 @@
from ansible.module_utils.common.dict_transformations import camel_dict_to_snake_dict
from ansible.module_utils.common.dict_transformations import snake_dict_to_camel_dict

import q # debug


class CodeDeployAnsibleAWSError(AnsibleAWSError):
pass
Expand Down Expand Up @@ -532,16 +530,14 @@ def _create_deployment_group(client, module):
response = client.create_deployment_group(**params)
return response
except (botocore.exceptions.BotoCoreError, botocore.exceptions.ClientError) as e:
q("Error: ", e)
raise CodeDeployAnsibleAWSError(exception=e, message="couldn't create deployment group")


def _update_deployment_group(client, module):
try:
q("Update deployment group")
params = prepare_present_options(module, state="update")
response = client.update_deployment_group(**params)
return response
return response
except (botocore.exceptions.BotoCoreError, botocore.exceptions.ClientError) as e:
raise CodeDeployAnsibleAWSError(exception=e, message="couldn't update deployment group")
return response # It'll be None
Expand Down Expand Up @@ -570,7 +566,7 @@ def ensure_deployment_group_present(client, module):
state = "create"
if not module.check_mode:
response = _create_deployment_group(client, module)

changed = True
else:
state = "update"
Expand Down Expand Up @@ -601,7 +597,6 @@ def ensure_deployment_group_absent(client, module):
else:
if not module.check_mode:
response = _delete_deployment_group(client, module)
q("response: ", response)
changed = True
if response is not None and response["hooksNotCleanedUp"]:
module.debug("AutoScaling LifecycleHook is not deleted. Please delete it manually.")
Expand All @@ -620,7 +615,7 @@ def prepare_present_options(module, state="present"):
raise CodeDeployAnsibleAWSError(message="service_role is required")
dg_params["deploymentGroupName"] = module.params["deployment_group_name"]
dg_params["serviceRoleArn"] = module.params["service_role"]

elif state == "update":
dg_params["currentDeploymentGroupName"] = module.params["deployment_group_name"]
if module.params["new_deployment_group_name"]:
Expand Down

0 comments on commit 22e8b6b

Please sign in to comment.