group = parser.add_mutually_exclusive_group(required=True)
group.add_argument('--reload', action='store_true', help='Apply the deltas', default=False)
group.add_argument('--test', action='store_true', help='Show the deltas', default=False)
- parser.add_argument('--debug', action='store_true', help='Enable debugs', default=False)
+ level_group = parser.add_mutually_exclusive_group()
+ level_group.add_argument('--debug', action='store_true',
+ help='Enable debugs (synonym for --log-level=debug)', default=False)
+ level_group.add_argument('--log-level', help='Log level', default="info",
+ choices=("critical", "error", "warning", "info", "debug"))
parser.add_argument('--stdout', action='store_true', help='Log to STDOUT', default=False)
+ parser.add_argument('--pathspace', '-N', metavar='NAME', help='Reload specified path/namespace', default=None)
parser.add_argument('filename', help='Location of new frr config file')
parser.add_argument('--overwrite', action='store_true', help='Overwrite frr.conf with running config output', default=False)
parser.add_argument('--bindir', help='path to the vtysh executable', default='/usr/bin')
# verify that the daemon, if specified, is valid
if args.daemon and args.daemon not in ['zebra', 'bgpd', 'fabricd', 'isisd', 'ospf6d', 'ospfd', 'pbrd', 'pimd', 'ripd', 'ripngd', 'sharpd', 'staticd', 'vrrpd', 'ldpd']:
- msg = "Daemon %s is not a valid option for 'show running-config'" % args.daemon
- print(msg)
- log.error(msg)
+ log.error("Daemon %s is not a valid option for 'show running-config'" % args.daemon)
sys.exit(1)
- vtysh = Vtysh(args.bindir, args.confdir, args.vty_socket)
+ vtysh = Vtysh(args.bindir, args.confdir, args.vty_socket, args.pathspace)
# Verify that 'service integrated-vtysh-config' is configured
- vtysh_filename = args.confdir + '/vtysh.conf'
+ if args.pathspace:
+ vtysh_filename = args.confdir + '/' + args.pathspace + '/vtysh.conf'
+ else:
+ vtysh_filename = args.confdir + '/vtysh.conf'
service_integrated_vtysh_config = True
if os.path.isfile(vtysh_filename):