mirror of
https://github.com/CumulusNetworks/ifupdown2.git
synced 2024-05-06 15:54:50 +00:00
argv: add new command line argument --nldebug
if --nldebug is provided, netlink debug message will be printed Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
This commit is contained in:
@@ -148,6 +148,13 @@ class Parse:
|
||||
help='type of interface entry (iface or vlan). '
|
||||
'This option can be used in case of ambiguity between '
|
||||
'a vlan interface and an iface interface of the same name')
|
||||
argparser.add_argument(
|
||||
"--nldebug",
|
||||
dest="nldebug",
|
||||
action="store_true",
|
||||
default=False,
|
||||
help="print netlink debug messages"
|
||||
)
|
||||
|
||||
def update_ifupdown_argparser(self, argparser):
|
||||
""" common arg parser for ifup and ifdown """
|
||||
|
@@ -219,7 +219,7 @@ class ifupdownMain:
|
||||
def link_exists(self, ifacename):
|
||||
return os.path.exists('/sys/class/net/%s' %ifacename)
|
||||
|
||||
def __init__(self, config={},
|
||||
def __init__(self, config={}, args=None,
|
||||
daemon=False, force=False, dryrun=False, nowait=False,
|
||||
perfmode=False, withdepends=False, njobs=1,
|
||||
cache=False, addons_enable=True, statemanager_enable=True,
|
||||
@@ -247,7 +247,7 @@ class ifupdownMain:
|
||||
self.reset_ifupdown2()
|
||||
else:
|
||||
# init nlcache with appropriate log level
|
||||
nlcache.NetlinkListenerWithCache.init(logging.root.level)
|
||||
nlcache.NetlinkListenerWithCache.init(logging.DEBUG if args.nldebug else logging.WARNING)
|
||||
|
||||
# start netlink listener and cache link/addr/netconf dumps
|
||||
nlcache.NetlinkListenerWithCache.get_instance().start()
|
||||
|
@@ -159,7 +159,7 @@ class Ifupdown2:
|
||||
log.debug('creating ifupdown object ..')
|
||||
cachearg = (False if (iflist or args.nocache or args.noact)
|
||||
else True)
|
||||
ifupdown_handle = ifupdownMain(daemon=self.daemon,
|
||||
ifupdown_handle = ifupdownMain(daemon=self.daemon, args=args,
|
||||
config=configmap_g,
|
||||
force=args.force,
|
||||
withdepends=args.withdepends,
|
||||
@@ -193,7 +193,7 @@ class Ifupdown2:
|
||||
try:
|
||||
iflist = args.iflist
|
||||
log.debug('creating ifupdown object ..')
|
||||
ifupdown_handle = ifupdownMain(daemon=self.daemon,
|
||||
ifupdown_handle = ifupdownMain(daemon=self.daemon, args=args,
|
||||
config=configmap_g, force=args.force,
|
||||
withdepends=args.withdepends,
|
||||
perfmode=args.perfmode,
|
||||
@@ -239,7 +239,7 @@ class Ifupdown2:
|
||||
iflist = [i for i in os.listdir('/sys/class/net/')
|
||||
if os.path.isdir('/sys/class/net/%s' % i)]
|
||||
log.debug('creating ifupdown object ..')
|
||||
ifupdown_handle = ifupdownMain(daemon=self.daemon,
|
||||
ifupdown_handle = ifupdownMain(daemon=self.daemon, args=args,
|
||||
config=configmap_g,
|
||||
withdepends=args.withdepends,
|
||||
perfmode=args.perfmode,
|
||||
@@ -263,7 +263,7 @@ class Ifupdown2:
|
||||
|
||||
try:
|
||||
log.debug('creating ifupdown object ..')
|
||||
ifupdown_handle = ifupdownMain(daemon=self.daemon,
|
||||
ifupdown_handle = ifupdownMain(daemon=self.daemon, args=args,
|
||||
config=configmap_g,
|
||||
interfacesfile=self.interfaces_filename,
|
||||
withdepends=args.withdepends,
|
||||
|
Reference in New Issue
Block a user