for ctx_key in ctx_keys:
cmd.append(ctx_key)
- return '\n' + '\n'.join(cmd)
+ cmd = '\n' + '\n'.join(cmd)
+
+ # There are some commands that are on by default so their "no" form will be
+ # displayed in the config. "no bgp default ipv4-unicast" is one of these.
+ # If we need to remove this line we do so by adding "bgp default ipv4-unicast",
+ # not by doing a "no no bgp default ipv4-unicast"
+ cmd = cmd.replace('no no ', '')
+
+ return cmd
def get_normalized_ipv6_line(line):
return (lines_to_add, lines_to_del)
+
if __name__ == '__main__':
# Command line options
parser = argparse.ArgumentParser(description='Dynamically apply diff in frr configs')