Skip to content

Commit

Permalink
adding support for vlanmode per issue jedelman8#15
Browse files Browse the repository at this point in the history
  • Loading branch information
jonasstenling committed Nov 23, 2015
1 parent 9bce231 commit 2c95b4f
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion pycsco/nxos/utils/nxapi_lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def get_vlan(device, vid):
Returns:
dictionary:
if VLAN exists - k/v pairs include vlan_id, name,
vlan_state
vlan_state, mode and admin_state
else: returns empty dictionary
"""
Expand All @@ -78,6 +78,12 @@ def get_vlan(device, vid):
vlan['vlan_id'] = str(vdata['vlanshowbr-vlanid-utf'])
vlan['name'] = str(vdata['vlanshowbr-vlanname'])
vlan['vlan_state'] = str(vdata['vlanshowbr-vlanstate'])
mdata = data_dict['ins_api']['outputs']['output']['body'].get(
'TABLE_mtuinfoid')['ROW_mtuinfoid']
if str(mdata['vlanshowinfo-vlanmode']) == 'fabricpath-vlan':
vlan['mode'] = 'fabricpath'
elif str(mdata['vlanshowinfo-vlanmode']) == 'ce-vlan':
vlan['mode'] = 'ce'
state = str(vdata['vlanshowbr-shutstate'])

if state == 'shutdown':
Expand Down

0 comments on commit 2c95b4f

Please sign in to comment.