mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Merge pull request #39560 from vutny/cloud-detect-ips
[CLOUD] Log error when private/public IP was not detected
This commit is contained in:
commit
cf37f83565
1 changed files with 15 additions and 8 deletions
|
@ -2122,14 +2122,21 @@ def query_instance(vm_=None, call=None):
|
|||
|
||||
log.debug('Returned query data: {0}'.format(data))
|
||||
|
||||
if ssh_interface(vm_) == 'public_ips' and 'ipAddress' in data[0]['instancesSet']['item']:
|
||||
log.error(
|
||||
'Public IP not detected.'
|
||||
)
|
||||
return data
|
||||
if ssh_interface(vm_) == 'private_ips' and \
|
||||
'privateIpAddress' in data[0]['instancesSet']['item']:
|
||||
return data
|
||||
if ssh_interface(vm_) == 'public_ips':
|
||||
if 'ipAddress' in data[0]['instancesSet']['item']:
|
||||
return data
|
||||
else:
|
||||
log.error(
|
||||
'Public IP not detected.'
|
||||
)
|
||||
|
||||
if ssh_interface(vm_) == 'private_ips':
|
||||
if 'privateIpAddress' in data[0]['instancesSet']['item']:
|
||||
return data
|
||||
else:
|
||||
log.error(
|
||||
'Private IP not detected.'
|
||||
)
|
||||
|
||||
try:
|
||||
data = salt.utils.cloud.wait_for_ip(
|
||||
|
|
Loading…
Add table
Reference in a new issue