Skip to content

Commit

Permalink
fixed error message for releasing an ip when not waiting for the nat …
Browse files Browse the repository at this point in the history
…gateway to delete successfully 1st
  • Loading branch information
linuxdynasty committed Aug 5, 2016
1 parent e5be46a commit dd275ca
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions cloud/amazon/ec2_vpc_nat_gateway.py
Original file line number Diff line number Diff line change
Expand Up @@ -655,7 +655,7 @@ def release_address(client, allocation_id, check_mode=False):
"""
err_msg = ''
if check_mode:
return True
return True, ''

ip_released = False
params = {
Expand Down Expand Up @@ -977,13 +977,13 @@ def remove(client, nat_gateway_id, wait=False, wait_timeout=0,
err_msg = str(e)

if release_eip:
eip_released, err = (
release_address(client, allocation_id, check_mode=check_mode)
eip_released, eip_err = (
release_address(client, allocation_id, check_mode)
)
if not eip_released:
err_msg = (
"{0}: Failed to release EIP {1}: {2}"
.format(err_msg, allocation_id, err)
.format(err_msg, allocation_id, eip_err)
)
success = False

Expand Down

0 comments on commit dd275ca

Please sign in to comment.