Skip to content

Commit

Permalink
ec2_vpc_dhcp_options_facts: fix exception handling, fixes build (ansi…
Browse files Browse the repository at this point in the history
  • Loading branch information
resmo authored and mattclay committed Dec 8, 2016
1 parent 4af6033 commit 4017be7
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@

try:
import botocore
import boto3
import boto3
HAS_BOTO3 = True
except ImportError:
HAS_BOTO3 = False
Expand Down Expand Up @@ -128,7 +128,7 @@ def list_dhcp_options(client, module):
snaked_dhcp_options_array = []
for dhcp_option in all_dhcp_options_array:
snaked_dhcp_options_array.append(camel_dict_to_snake_dict(dhcp_option))

module.exit_json(dhcp_options=snaked_dhcp_options_array)


Expand All @@ -151,12 +151,12 @@ def main():
try:
region, ec2_url, aws_connect_kwargs = get_aws_connection_info(module, boto3=True)
connection = boto3_conn(module, conn_type='client', resource='ec2', region=region, endpoint=ec2_url, **aws_connect_kwargs)
except botocore.exceptions.NoCredentialsError, e:
except botocore.exceptions.NoCredentialsError as e:
module.fail_json(msg="Can't authorize connection - "+str(e))

# call your function here
results = list_dhcp_options(connection, module)

module.exit_json(result=results)

# import module snippets
Expand Down

0 comments on commit 4017be7

Please sign in to comment.