Merge pull request #46482 from rongshengfang/fix-keyerror-in-instance_present

Fix KeyError in salt/states/boto_ec2.py
This commit is contained in:
Nicole Thomas 2018-03-12 11:13:12 -04:00 committed by GitHub
commit c7e05d3ff4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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