diff options
Diffstat (limited to 'plugins')
3 files changed, 8 insertions, 17 deletions
diff --git a/plugins/module_utils/network/vyos/facts/ospf_interfaces/ospf_interfaces.py b/plugins/module_utils/network/vyos/facts/ospf_interfaces/ospf_interfaces.py index c0e74895..852e1da7 100644 --- a/plugins/module_utils/network/vyos/facts/ospf_interfaces/ospf_interfaces.py +++ b/plugins/module_utils/network/vyos/facts/ospf_interfaces/ospf_interfaces.py @@ -50,21 +50,12 @@ class Ospf_interfacesFacts(object): def get_config_set_1_4(self, data): """To classify the configurations beased on interface""" - interface_list = [] - config_set = [] - int_string = "" + config_dict = {} for config_line in data.splitlines(): - ospf_int = re.search(r"set protocols (?:ospf|ospfv3) interface (\S+) .*", config_line) + ospf_int = re.search(r"set protocols (?:ospf|ospfv3) interface (\S+).*", config_line) if ospf_int: - if ospf_int.group(1) not in interface_list: - if int_string: - config_set.append(int_string) - interface_list.append(ospf_int.group(1)) - int_string = "" - int_string = int_string + config_line + "\n" - if int_string: - config_set.append(int_string) - return config_set + config_dict[ospf_int.group(1)] = config_dict.get(ospf_int.group(1), "") + config_line + "\n" + return list(config_dict.values()) def get_config_set_1_2(self, data): """To classify the configurations beased on interface""" diff --git a/plugins/module_utils/network/vyos/rm_templates/ospf_interfaces.py b/plugins/module_utils/network/vyos/rm_templates/ospf_interfaces.py index aaaf7ff2..0d7eaf84 100644 --- a/plugins/module_utils/network/vyos/rm_templates/ospf_interfaces.py +++ b/plugins/module_utils/network/vyos/rm_templates/ospf_interfaces.py @@ -509,7 +509,7 @@ class Ospf_interfacesTemplate(NetworkTemplate): \s+(?P<name>\S+) \s+(?P<afi>ip|ipv6) \s+(?P<proto>ospf|ospfv3) - \s+(?P<mtu>\'mtu-ignore\') + \s+(?P<mtu>mtu-ignore) *$""", re.VERBOSE, ), @@ -697,7 +697,7 @@ class Ospf_interfacesTemplate(NetworkTemplate): \s+(?P<name>\S+) \s+(?P<afi>ip|ipv6) \s+(?P<proto>ospf|ospfv3) - \s+(?P<pass>\'passive\') + \s+(?P<pass>passive) *$""", re.VERBOSE, ), diff --git a/plugins/module_utils/network/vyos/rm_templates/ospf_interfaces_14.py b/plugins/module_utils/network/vyos/rm_templates/ospf_interfaces_14.py index 7f49d47a..43fae1e9 100644 --- a/plugins/module_utils/network/vyos/rm_templates/ospf_interfaces_14.py +++ b/plugins/module_utils/network/vyos/rm_templates/ospf_interfaces_14.py @@ -432,7 +432,7 @@ class Ospf_interfacesTemplate14(NetworkTemplate): \s+(?P<proto>ospf|ospfv3) \s+interface \s+(?P<name>\S+) - \s+(?P<mtu>\'mtu-ignore\') + \s+(?P<mtu>mtu-ignore) *$""", re.VERBOSE, ), @@ -613,7 +613,7 @@ class Ospf_interfacesTemplate14(NetworkTemplate): \s+(?P<proto>ospf|ospfv3) \s+interface \s+(?P<name>\S+) - \s+(?P<pass>\'passive\') + \s+(?P<pass>passive) *$""", re.VERBOSE, ), |