"ip ",
"ipv6 ",
"log ",
- "mpls",
+ "mpls lsp",
+ "mpls label",
"no ",
"password ",
"ptm-enable",
continue
# one line contexts
- if new_ctx is True and any(line.startswith(keyword) for keyword in oneline_ctx_keywords):
+ # there is one exception though: ldpd accepts a 'router-id' clause
+ # as part of its 'mpls ldp' config context. If we are processing
+ # ldp configuration and encounter a router-id we should NOT switch
+ # to a new context
+ if new_ctx is True and any(line.startswith(keyword) for keyword in oneline_ctx_keywords) and not (
+ ctx_keys and ctx_keys[0].startswith("mpls ldp") and line.startswith("router-id ")):
self.save_contexts(ctx_keys, current_context_lines)
# Start a new context
elif (line.startswith("address-family ") or
line.startswith("vnc defaults") or
line.startswith("vnc l2-group") or
- line.startswith("vnc nve-group")):
+ line.startswith("vnc nve-group") or
+ line.startswith("member pseudowire")):
main_ctx_key = []
# Save old context first
main_ctx_key = copy.deepcopy(ctx_keys)
log.debug('LINE %-50s: entering sub-context, append to ctx_keys', line)
- if line == "address-family ipv6":
+ if line == "address-family ipv6" and not ctx_keys[0].startswith("mpls ldp"):
ctx_keys.append("address-family ipv6 unicast")
- elif line == "address-family ipv4":
+ elif line == "address-family ipv4" and not ctx_keys[0].startswith("mpls ldp"):
ctx_keys.append("address-family ipv4 unicast")
elif line == "address-family evpn":
ctx_keys.append("address-family l2vpn evpn")
switch (vty->node) {
case LDP_IPV4_IFACE_NODE:
if (strncmp(vty_buf_copy, " ", 3)) {
- vty_out(vty, " end\n");
vty->node = LDP_IPV4_NODE;
}
break;
case LDP_IPV6_IFACE_NODE:
if (strncmp(vty_buf_copy, " ", 3)) {
- vty_out(vty, " end\n");
vty->node = LDP_IPV6_NODE;
}
break;
case LDP_PSEUDOWIRE_NODE:
if (strncmp(vty_buf_copy, " ", 2)) {
- vty_out(vty, " end\n");
+ vty_out(vty, " exit\n");
vty->node = LDP_L2VPN_NODE;
}
break;