mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
fix bug that would cause stack trace in nxos_nxapi (#21861)
The parse_sandbox function will generate a stack trace if the command is not supported. This patch will resolve that issue.
This commit is contained in:
parent
942ed42eb0
commit
06d0278290
1 changed files with 4 additions and 1 deletions
|
@ -205,7 +205,10 @@ def parse_https(data):
|
||||||
|
|
||||||
def parse_sandbox(data):
|
def parse_sandbox(data):
|
||||||
match = re.search('Sandbox:\s+(.+)$', data, re.M)
|
match = re.search('Sandbox:\s+(.+)$', data, re.M)
|
||||||
return {'sandbox': match.group(1) == 'Enabled'}
|
value = None
|
||||||
|
if match:
|
||||||
|
value = match.group(1) == 'Enabled'
|
||||||
|
return {'sandbox': value}
|
||||||
|
|
||||||
def map_config_to_obj(module):
|
def map_config_to_obj(module):
|
||||||
out = run_commands(module, ['show nxapi'], check_rc=False)
|
out = run_commands(module, ['show nxapi'], check_rc=False)
|
||||||
|
|
Loading…
Reference in a new issue