Don't report existing instances as running only if they're actually terminated

Fixes #27532
This commit is contained in:
rallytime 2015-09-30 14:19:33 -06:00
parent fd11e0cd95
commit da6b4b3604

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 = 'Already running, 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}'