From 2c95b4f4aca4f0e605d4171b82d1f84c85ff6c49 Mon Sep 17 00:00:00 2001 From: Jonas Stenling Date: Mon, 23 Nov 2015 09:32:10 +0100 Subject: [PATCH] adding support for vlanmode per issue #15 --- pycsco/nxos/utils/nxapi_lib.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/pycsco/nxos/utils/nxapi_lib.py b/pycsco/nxos/utils/nxapi_lib.py index b8a924e..16cdb3e 100644 --- a/pycsco/nxos/utils/nxapi_lib.py +++ b/pycsco/nxos/utils/nxapi_lib.py @@ -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 """ @@ -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':