To fix the bug where IOS vlans module throws traceback (#64633)

* fix 64515

* add fix
This commit is contained in:
Sumit Jaiswal 2019-12-27 20:49:29 +05:30 committed by GitHub
parent b733178bac
commit c5a2ba5217
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -111,7 +111,7 @@ class VlansFacts(object):
config = deepcopy(spec) config = deepcopy(spec)
if vlan_info == 'Name' and 'Name' not in conf: if vlan_info == 'Name' and 'Name' not in conf:
conf = filter(None, conf.split(' ')) conf = list(filter(None, conf.split(' ')))
config['vlan_id'] = int(conf[0]) config['vlan_id'] = int(conf[0])
config['name'] = conf[1] config['name'] = conf[1]
if len(conf[2].split('/')) > 1: if len(conf[2].split('/')) > 1:
@ -127,7 +127,7 @@ class VlansFacts(object):
config['state'] = 'active' config['state'] = 'active'
config['shutdown'] = 'disabled' config['shutdown'] = 'disabled'
elif vlan_info == 'Type' and 'Type' not in conf: elif vlan_info == 'Type' and 'Type' not in conf:
conf = filter(None, conf.split(' ')) conf = list(filter(None, conf.split(' ')))
config['mtu'] = int(conf[3]) config['mtu'] = int(conf[3])
elif vlan_info == 'Remote': elif vlan_info == 'Remote':
if len(conf.split(',')) > 1 or conf.isdigit(): if len(conf.split(',')) > 1 or conf.isdigit():