Fixes #30769 - nxos_vtp_version errors out on N1 images. (#30770)

* Fixes #30769

* add the same fix for 2 more vtp modules
This commit is contained in:
rahushen 2017-10-03 07:54:14 -04:00 committed by Trishna Guha
parent 17fbeeb2f0
commit a12a05c219
3 changed files with 21 additions and 12 deletions

View file

@ -149,10 +149,13 @@ def get_vtp_config(module):
def get_vtp_password(module):
command = 'show vtp password'
body = execute_show_command(command, module)[0]
password = body['passwd']
if password:
return str(password)
else:
try:
password = body['passwd']
if password:
return str(password)
else:
return ""
except TypeError:
return ""

View file

@ -180,10 +180,13 @@ def get_vtp_config(module):
def get_vtp_password(module):
command = 'show vtp password'
body = execute_show_command(command, module)[0]
password = body['passwd']
if password:
return str(password)
else:
try:
password = body['passwd']
if password:
return str(password)
else:
return ""
except TypeError:
return ""

View file

@ -147,10 +147,13 @@ def get_vtp_config(module):
def get_vtp_password(module):
command = 'show vtp password'
body = execute_show_command(command, module)[0]
password = body['passwd']
if password:
return str(password)
else:
try:
password = body['passwd']
if password:
return str(password)
else:
return ""
except TypeError:
return ""