Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
r"route-map ([^\s]+) out", neighbor_config
)
import_policy = napalm.base.helpers.regex_find_txt(
r"route-map ([^\s]+) in", neighbor_config
)
local_address = napalm.base.helpers.regex_find_txt(
r" update-source (\w+)", neighbor_config
)
local_as = napalm.base.helpers.regex_find_txt(
r"local-as (\d+)", neighbor_config, default=0
)
password = napalm.base.helpers.regex_find_txt(
r"password (?:[0-9] )?([^\']+\')", neighbor_config
)
nhs = bool(
napalm.base.helpers.regex_find_txt(r" next-hop-self", neighbor_config)
)
route_reflector_client = bool(
napalm.base.helpers.regex_find_txt(
r"route-reflector-client", neighbor_config
)
)
# Add the group name to bgp_group_neighbors if its not there already
if group_name not in bgp_group_neighbors.keys():
bgp_group_neighbors[group_name] = {}
# Build the neighbor dict of attributes
bgp_group_neighbors[group_name][bgp_neighbor] = {
"description": description,
"remote_as": peer_as,
"prefix_limit": build_prefix_limit(
r"route-map ([^\s]+) in", neighbor_config
)
local_address = napalm.base.helpers.regex_find_txt(
r" update-source (\w+)", neighbor_config
)
local_as = napalm.base.helpers.regex_find_txt(
r"local-as (\d+)", neighbor_config, default=0
)
password = napalm.base.helpers.regex_find_txt(
r"password (?:[0-9] )?([^\']+\')", neighbor_config
)
nhs = bool(
napalm.base.helpers.regex_find_txt(r" next-hop-self", neighbor_config)
)
route_reflector_client = bool(
napalm.base.helpers.regex_find_txt(
r"route-reflector-client", neighbor_config
)
)
# Add the group name to bgp_group_neighbors if its not there already
if group_name not in bgp_group_neighbors.keys():
bgp_group_neighbors[group_name] = {}
# Build the neighbor dict of attributes
bgp_group_neighbors[group_name][bgp_neighbor] = {
"description": description,
"remote_as": peer_as,
"prefix_limit": build_prefix_limit(
afi, prefix_limit, prefix_percent, prefix_timeout
),
"export_policy": export_policy,
prefix_limit = napalm.base.helpers.regex_find_txt(
r"maximum-prefix (\d+) \d+ \w+ \d+", neighbor_config, default=0
)
prefix_percent = napalm.base.helpers.regex_find_txt(
r"maximum-prefix \d+ (\d+) \w+ \d+", neighbor_config, default=0
)
prefix_timeout = napalm.base.helpers.regex_find_txt(
r"maximum-prefix \d+ \d+ \w+ (\d+)", neighbor_config, default=0
)
export_policy = napalm.base.helpers.regex_find_txt(
r"route-map ([^\s]+) out", neighbor_config
)
import_policy = napalm.base.helpers.regex_find_txt(
r"route-map ([^\s]+) in", neighbor_config
)
local_address = napalm.base.helpers.regex_find_txt(
r" update-source (\w+)", neighbor_config
)
local_as = napalm.base.helpers.regex_find_txt(
r"local-as (\d+)", neighbor_config, default=0
)
password = napalm.base.helpers.regex_find_txt(
r"password (?:[0-9] )?([^\']+\')", neighbor_config
)
nhs = bool(
napalm.base.helpers.regex_find_txt(r" next-hop-self", neighbor_config)
)
route_reflector_client = bool(
napalm.base.helpers.regex_find_txt(
r"route-reflector-client", neighbor_config
)
)
for afi in afi_list:
afi_config = napalm.base.helpers.cisco_conf_parse_objects(
afi, bgp_config_text
)
multipath = bool(
napalm.base.helpers.regex_find_txt(r" multipath", str(afi_config))
)
if multipath:
break
description = napalm.base.helpers.regex_find_txt(
r" description ([^\']+)\'", neighbor_config
)
local_as = napalm.base.helpers.regex_find_txt(
r"local-as (\d+)", neighbor_config, default=0
)
import_policy = napalm.base.helpers.regex_find_txt(
r"route-map ([^\s]+) in", neighbor_config
)
export_policy = napalm.base.helpers.regex_find_txt(
r"route-map ([^\s]+) out", neighbor_config
)
local_address = napalm.base.helpers.regex_find_txt(
r" update-source (\w+)", neighbor_config
)
multihop_ttl = napalm.base.helpers.regex_find_txt(
r"ebgp-multihop {\d+}", neighbor_config, default=0
)
peer_as = napalm.base.helpers.regex_find_txt(
r" remote-as (\d+)", neighbor_config, default=0
)
remove_private_as = bool(
napalm.base.helpers.regex_find_txt(
description = napalm.base.helpers.regex_find_txt(
r" description ([^\']+)\'", neighbor_config
)
local_as = napalm.base.helpers.regex_find_txt(
r"local-as (\d+)", neighbor_config, default=0
)
import_policy = napalm.base.helpers.regex_find_txt(
r"route-map ([^\s]+) in", neighbor_config
)
export_policy = napalm.base.helpers.regex_find_txt(
r"route-map ([^\s]+) out", neighbor_config
)
local_address = napalm.base.helpers.regex_find_txt(
r" update-source (\w+)", neighbor_config
)
multihop_ttl = napalm.base.helpers.regex_find_txt(
r"ebgp-multihop {\d+}", neighbor_config, default=0
)
peer_as = napalm.base.helpers.regex_find_txt(
r" remote-as (\d+)", neighbor_config, default=0
)
remove_private_as = bool(
napalm.base.helpers.regex_find_txt(
r"remove-private-as", neighbor_config
)
)
prefix_limit = napalm.base.helpers.regex_find_txt(
r"maximum-prefix (\d+) \d+ \w+ \d+", neighbor_config, default=0
)
prefix_percent = napalm.base.helpers.regex_find_txt(
r"maximum-prefix \d+ (\d+) \w+ \d+", neighbor_config, default=0
)
local_as = napalm.base.helpers.regex_find_txt(
r"local-as (\d+)", neighbor_config, default=0
)
import_policy = napalm.base.helpers.regex_find_txt(
r"route-map ([^\s]+) in", neighbor_config
)
export_policy = napalm.base.helpers.regex_find_txt(
r"route-map ([^\s]+) out", neighbor_config
)
local_address = napalm.base.helpers.regex_find_txt(
r" update-source (\w+)", neighbor_config
)
multihop_ttl = napalm.base.helpers.regex_find_txt(
r"ebgp-multihop {\d+}", neighbor_config, default=0
)
peer_as = napalm.base.helpers.regex_find_txt(
r" remote-as (\d+)", neighbor_config, default=0
)
remove_private_as = bool(
napalm.base.helpers.regex_find_txt(
r"remove-private-as", neighbor_config
)
)
prefix_limit = napalm.base.helpers.regex_find_txt(
r"maximum-prefix (\d+) \d+ \w+ \d+", neighbor_config, default=0
)
prefix_percent = napalm.base.helpers.regex_find_txt(
r"maximum-prefix \d+ (\d+) \w+ \d+", neighbor_config, default=0
)
prefix_timeout = napalm.base.helpers.regex_find_txt(
r"maximum-prefix \d+ \d+ \w+ (\d+)", neighbor_config, default=0
)
prefix_timeout = napalm.base.helpers.regex_find_txt(
r"maximum-prefix \d+ \d+ \w+ (\d+)", neighbor_config, default=0
)
export_policy = napalm.base.helpers.regex_find_txt(
r"route-map ([^\s]+) out", neighbor_config
)
import_policy = napalm.base.helpers.regex_find_txt(
r"route-map ([^\s]+) in", neighbor_config
)
local_address = napalm.base.helpers.regex_find_txt(
r" update-source (\w+)", neighbor_config
)
local_as = napalm.base.helpers.regex_find_txt(
r"local-as (\d+)", neighbor_config, default=0
)
password = napalm.base.helpers.regex_find_txt(
r"password (?:[0-9] )?([^\']+\')", neighbor_config
)
nhs = bool(
napalm.base.helpers.regex_find_txt(r" next-hop-self", neighbor_config)
)
route_reflector_client = bool(
napalm.base.helpers.regex_find_txt(
r"route-reflector-client", neighbor_config
)
)
# Add the group name to bgp_group_neighbors if its not there already
if group_name not in bgp_group_neighbors.keys():
bgp_group_neighbors[group_name] = {}
# Build the neighbor dict of attributes
)
multipath = bool(
napalm.base.helpers.regex_find_txt(r" multipath", str(afi_config))
)
if multipath:
break
description = napalm.base.helpers.regex_find_txt(
r" description ([^\']+)\'", neighbor_config
)
local_as = napalm.base.helpers.regex_find_txt(
r"local-as (\d+)", neighbor_config, default=0
)
import_policy = napalm.base.helpers.regex_find_txt(
r"route-map ([^\s]+) in", neighbor_config
)
export_policy = napalm.base.helpers.regex_find_txt(
r"route-map ([^\s]+) out", neighbor_config
)
local_address = napalm.base.helpers.regex_find_txt(
r" update-source (\w+)", neighbor_config
)
multihop_ttl = napalm.base.helpers.regex_find_txt(
r"ebgp-multihop {\d+}", neighbor_config, default=0
)
peer_as = napalm.base.helpers.regex_find_txt(
r" remote-as (\d+)", neighbor_config, default=0
)
remove_private_as = bool(
napalm.base.helpers.regex_find_txt(
r"remove-private-as", neighbor_config
)
)