Fix KeyError in salt/states/boto_ec2.py when an EIP is being associated to an

existing instance with the instance_present state.

Fixes #46479.
This commit is contained in:
Rongsheng Fang 2018-03-10 09:19:37 -05:00
parent 573d51afec
commit ed8c83e89a

View file

@ -886,6 +886,8 @@ def instance_present(name, instance_name=None, instance_id=None, image_id=None,
allocation_id=allocation_id, region=region, key=key,
keyid=keyid, profile=profile)
if r:
if 'new' not in ret['changes']:
ret['changes']['new'] = {}
ret['changes']['new']['public_ip'] = ip
else:
ret['result'] = False