mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-10-08 01:14:03 -07:00
Fixing error exception handling for python3. Does not need to be compa… (#3840)
* Fixing error exception handling for python. Does not need to be compatible with Python2.4 b/c boto is Python 2.6 and above. * Fixing error exception handling for python. Does not need to be compatible with Python2.4 b/c boto is Python 2.6 and above. * Fixing compile time errors IRT error exception handling for Python 3.5. This does not need to be compatible with Python2.4 b/c Boto is Python 2.6 and above.
This commit is contained in:
parent
1573066ec1
commit
3fa745eef9
24 changed files with 173 additions and 173 deletions
|
@ -234,7 +234,7 @@ def find_device(ec2, device_id, isinstance=True):
|
|||
if isinstance:
|
||||
try:
|
||||
reservations = ec2.get_all_reservations(instance_ids=[device_id])
|
||||
except boto.exception.EC2ResponseError, e:
|
||||
except boto.exception.EC2ResponseError as e:
|
||||
module.fail_json(msg=str(e))
|
||||
|
||||
if len(reservations) == 1:
|
||||
|
@ -244,7 +244,7 @@ def find_device(ec2, device_id, isinstance=True):
|
|||
else:
|
||||
try:
|
||||
interfaces = ec2.get_all_network_interfaces(network_interface_ids=[device_id])
|
||||
except boto.exception.EC2ResponseError, e:
|
||||
except boto.exception.EC2ResponseError as e:
|
||||
module.fail_json(msg=str(e))
|
||||
|
||||
if len(interfaces) == 1:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue