Merge pull request #27575 from rallytime/fix-27532

Don't report existing instances as running only if they're actually terminated in EC2
This commit is contained in:
Joseph Hall 2015-09-30 16:17:24 -06:00
commit 1a31b19f15

View file

@ -342,7 +342,11 @@ class SaltCloud(parsers.SaltCloudParser):
if dmap.get('existing', None):
for name in dmap['existing']:
ret[name] = {'Message': 'Already running'}
if 'ec2' in dmap['existing'][name]['provider']:
msg = 'Instance already exists, or is terminated and has the same name.'
else:
msg = 'Already running.'
ret[name] = {'Message': msg}
except (SaltCloudException, Exception) as exc:
msg = 'There was a query error: {0}'