|
|
@ -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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|