current_context_lines = []
log.debug('LINE %-50s: popping from subcontext to ctx%-50s', line, ctx_keys)
- elif line == "exit-vni":
+ elif line in ["exit-vni", "exit-ldp-if"]:
if sub_main_ctx_key:
self.save_contexts(ctx_keys, current_context_lines)
sub_main_ctx_key = copy.deepcopy(ctx_keys)
log.debug('LINE %-50s: entering sub-sub-context, append to ctx_keys', line)
ctx_keys.append(line)
+
+ elif ((line.startswith("interface ") and
+ len(ctx_keys) == 2 and
+ ctx_keys[0].startswith('mpls ldp') and
+ ctx_keys[1].startswith('address-family'))):
+
+ # Save old context first
+ self.save_contexts(ctx_keys, current_context_lines)
+ current_context_lines = []
+ sub_main_ctx_key = copy.deepcopy(ctx_keys)
+ log.debug('LINE %-50s: entering sub-sub-context, append to ctx_keys', line)
+ ctx_keys.append(line)
else:
# Continuing in an existing context, add non-commented lines to it
switch (vty->node) {
case LDP_IPV4_IFACE_NODE:
if (strncmp(vty_buf_copy, " ", 3)) {
+ vty_out(vty, " exit-ldp-if\n");
vty->node = LDP_IPV4_NODE;
}
break;
case LDP_IPV6_IFACE_NODE:
if (strncmp(vty_buf_copy, " ", 3)) {
+ vty_out(vty, " exit-ldp-if\n");
vty->node = LDP_IPV6_NODE;
}
break;