Coverity Bug Fix for cnos_vrf.py (#55954)

* Coverity Bug Fix for cnos_vrf.py

* Update cnos_vrf.py
pull/55992/head
Anil Kumar Muraleedharan 6 years ago committed by Nathaniel Case
parent 6610d678f8
commit d9a1c8954f

@ -228,8 +228,7 @@ def map_obj_to_commands(updates, module):
def map_config_to_obj(module): def map_config_to_obj(module):
objs = [] objs = []
output = run_commands(module, {'command': 'show vrf'}) output = run_commands(module, {'command': 'show vrf'})
if output is None: if output is not None:
module.fail_json(msg='Could not fetch VRF details from device')
vrfText = output[0].strip() vrfText = output[0].strip()
vrfList = vrfText.split('VRF') vrfList = vrfText.split('VRF')
for vrfItem in vrfList: for vrfItem in vrfList:
@ -248,7 +247,8 @@ def map_config_to_obj(module):
if '!' not in intName and 'Interfaces' not in intName: if '!' not in intName and 'Interfaces' not in intName:
obj['interfaces'].append(intName.strip().lower()) obj['interfaces'].append(intName.strip().lower())
objs.append(obj) objs.append(obj)
else:
module.fail_json(msg='Could not fetch VRF details from device')
return objs return objs

Loading…
Cancel
Save