mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 01:18:58 +00:00
Display error in else condition if connection is unsuccessful and does not have msg attribute. Fixes #25809
This commit is contained in:
parent
474a250414
commit
ad9895de07
@ -202,11 +202,13 @@ def _get_si():
|
||||
port=port
|
||||
)
|
||||
ssl._create_default_https_context = default_context
|
||||
except:
|
||||
err_msg = exc.msg if isinstance(exc, vim.fault.InvalidLogin) and hasattr(exc, 'msg') else 'Could not connect to the specified vCenter server. Please check the specified protocol or url or port'
|
||||
except Exception as exc:
|
||||
err_msg = exc.msg if hasattr(exc, 'msg') else 'Could not connect to the specified vCenter server. Please check the debug log for more information'
|
||||
log.debug(exc)
|
||||
raise SaltCloudSystemExit(err_msg)
|
||||
else:
|
||||
err_msg = exc.msg if isinstance(exc, vim.fault.InvalidLogin) and hasattr(exc, 'msg') else 'Could not connect to the specified vCenter server. Please check the specified protocol or url or port'
|
||||
err_msg = exc.msg if hasattr(exc, 'msg') else 'Could not connect to the specified vCenter server. Please check the debug log for more information'
|
||||
log.debug(exc)
|
||||
raise SaltCloudSystemExit(err_msg)
|
||||
|
||||
atexit.register(Disconnect, si)
|
||||
|
Loading…
Reference in New Issue
Block a user