From 91067b3d23e82b96628f2babbf71a773bc43ec96 Mon Sep 17 00:00:00 2001 From: roopa Date: Thu, 27 Mar 2014 16:36:54 -0700 Subject: [PATCH] Remove batch support when deleting addresses. batching code does not update the cache yet and that can cause problems during add Ticket: CM-2491 Reviewed By: Testing Done: Still working on the cache update support during batching. --- man.rst/ifreload.8.rst | 25 ++++++++++--------------- pkg/ifupdownmain.py | 6 +----- sbin/ifupdown | 9 +++------ 3 files changed, 14 insertions(+), 26 deletions(-) diff --git a/man.rst/ifreload.8.rst b/man.rst/ifreload.8.rst index 9356dd9..3402eab 100644 --- a/man.rst/ifreload.8.rst +++ b/man.rst/ifreload.8.rst @@ -14,18 +14,19 @@ reload network interface configuration SYNOPSIS ======== - ifreload [-h] [-a] [-v] [-d] [--allow CLASS] [--with-depends] - [-X EXCLUDEPATS] [-f] [-n] [--print-dependency {list,dot}] - [--down-changediface] - [IFACE [IFACE ...]] + ifreload [-h] [-a] [-v] [-d] [-f] [-n] DESCRIPTION =========== reloads network interfaces(5) file /etc/network/interfaces. - runs ifdown on interfaces that were there previously but are no longer - in the interfaces file and ifup on all interfaces in the current - /etc/network/interfaces file. + runs ifdown on interfaces that changed in the interfaces file and + subsequently runs ifup on all interfaces. + + ifreload is equivalent to ``ifdown -a`` followed by ``ifup -a`` + but it skips ifdown for interfaces that did not change in the config + file. + OPTIONS ======= @@ -39,14 +40,8 @@ OPTIONS -f, --force force run all operations - --down-changediface run down and then up on interfaces that changed from - the last installed version of the interfaces file. - Without this option, ifup is executed on all - interfaces - - -CHEATSHEET -========== +EXAMPLES +======== # reload /etc/network/interfaces file ifreload -a diff --git a/pkg/ifupdownmain.py b/pkg/ifupdownmain.py index ddc4e17..8a5ea6e 100644 --- a/pkg/ifupdownmain.py +++ b/pkg/ifupdownmain.py @@ -25,8 +25,6 @@ from sets import Set class ifupdownMain(ifupdownBase): """ ifupdown2 main class """ - - # Flags WITH_DEPENDS = False ALL = False @@ -736,7 +734,7 @@ class ifupdownMain(ifupdownBase): return def reload(self, upops, downops, auto=False, allow=None, - ifacenames=None, excludepats=None, downchangediface=False): + ifacenames=None, excludepats=None): """ reload interface config """ allow_classes = [] @@ -792,8 +790,6 @@ class ifupdownMain(ifupdownBase): if not newifaceobjlist: ifacedownlist.append(ifname) continue - if not downchangediface: - continue # If interface has changed between the current file # and the last installed append it to the down list if len(newifaceobjlist) != len(lastifaceobjlist): diff --git a/sbin/ifupdown b/sbin/ifupdown index 8e1b21c..b589307 100755 --- a/sbin/ifupdown +++ b/sbin/ifupdown @@ -123,8 +123,7 @@ def run_reload(args): ifupdown_handle.reload(['pre-up', 'up', 'post-up'], ['pre-down', 'down', 'post-down'], args.all, None, None, - excludepats=args.excludepats, - downchangediface=args.downchangediface) + excludepats=args.excludepats) except: raise @@ -264,14 +263,12 @@ def update_ifreload_argparser(argparser): help=argparse.SUPPRESS) argparser.add_argument('-j', '--jobs', dest='jobs', type=int, default=-1, choices=range(1,12), help=argparse.SUPPRESS) - argparser.add_argument('--down-changediface', dest='downchangediface', - action='store_true', help='down interfaces whose ' + - 'config have changed before bringing them up. By' + - ' default all interfaces are brought up') def parse_args(argsv, op): if op == 'query': descr = 'query interfaces (all or interface list)' + elif op == 'reload': + descr = 'reload interface configuration.' else: descr = 'interface management' argparser = argparse.ArgumentParser(description=descr)