Fixed ec2_eip.py when assigning a standard elastic IP. (#19238)

pull/19316/merge
Ivan Nikolov 8 years ago committed by Ryan Brown
parent e0d4050612
commit fcb1a2b6cc

@ -312,7 +312,7 @@ def ensure_present(ec2, module, domain, address, private_ip_address, device_id,
if isinstance: if isinstance:
instance = find_device(ec2, module, device_id) instance = find_device(ec2, module, device_id)
if reuse_existing_ip_allowed: if reuse_existing_ip_allowed:
if len(instance.vpc_id) > 0 and domain is None: if instance.vpc_id and len(instance.vpc_id) > 0 and domain is None:
raise EIPException("You must set 'in_vpc' to true to associate an instance with an existing ip in a vpc") raise EIPException("You must set 'in_vpc' to true to associate an instance with an existing ip in a vpc")
# Associate address object (provided or allocated) with instance # Associate address object (provided or allocated) with instance
assoc_result = associate_ip_and_device(ec2, address, private_ip_address, device_id, assoc_result = associate_ip_and_device(ec2, address, private_ip_address, device_id,

Loading…
Cancel
Save