mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Prevent stacktrace if something goes wrong retrieving inventory
This commit is contained in:
parent
e7cbce15a5
commit
04095e3b74
2 changed files with 7 additions and 1 deletions
|
@ -55,7 +55,7 @@ def _find_credentials():
|
|||
return (u, p)
|
||||
|
||||
|
||||
log.debug('grains fx2._find_credentials found no valid credentials, using Dell default')
|
||||
logger.debug('grains fx2._find_credentials found no valid credentials, using Dell default')
|
||||
return ('root', 'calvin')
|
||||
|
||||
|
||||
|
|
|
@ -243,6 +243,12 @@ def network_info(host=None,
|
|||
|
||||
inv = inventory(host=host, admin_username=admin_username,
|
||||
admin_password=admin_password)
|
||||
if inv is None:
|
||||
cmd = {}
|
||||
cmd['retcode'] = -1
|
||||
cmd['stdout'] = 'Problem getting switch inventory'
|
||||
return cmd
|
||||
|
||||
if module not in inv.get('switch'):
|
||||
cmd = {}
|
||||
cmd['retcode'] = -1
|
||||
|
|
Loading…
Add table
Reference in a new issue