|
|
@ -79,13 +79,17 @@ class InterfacesFacts(object):
|
|
|
|
|
|
|
|
|
|
|
|
config = deepcopy(spec)
|
|
|
|
config = deepcopy(spec)
|
|
|
|
match = re.search(r'^(\S+)', conf)
|
|
|
|
match = re.search(r'^(\S+)', conf)
|
|
|
|
if match.group(1).lower() == "preconfigure":
|
|
|
|
|
|
|
|
match = re.search(r'^(\S+ \S+)', conf)
|
|
|
|
|
|
|
|
intf = match.group(1)
|
|
|
|
intf = match.group(1)
|
|
|
|
|
|
|
|
if match.group(1).lower() == "preconfigure":
|
|
|
|
|
|
|
|
match = re.search(r'^(\S+) (.*)', conf)
|
|
|
|
|
|
|
|
if match:
|
|
|
|
|
|
|
|
intf = match.group(2)
|
|
|
|
|
|
|
|
|
|
|
|
if get_interface_type(intf) == 'unknown':
|
|
|
|
if get_interface_type(intf) == 'unknown':
|
|
|
|
return {}
|
|
|
|
return {}
|
|
|
|
# populate the facts from the configuration
|
|
|
|
# populate the facts from the configuration
|
|
|
|
config['name'] = normalize_interface(intf)
|
|
|
|
config['name'] = intf
|
|
|
|
config['description'] = utils.parse_conf_arg(conf, 'description')
|
|
|
|
config['description'] = utils.parse_conf_arg(conf, 'description')
|
|
|
|
if utils.parse_conf_arg(conf, 'speed'):
|
|
|
|
if utils.parse_conf_arg(conf, 'speed'):
|
|
|
|
config['speed'] = int(utils.parse_conf_arg(conf, 'speed'))
|
|
|
|
config['speed'] = int(utils.parse_conf_arg(conf, 'speed'))
|
|
|
|