From 3304fa066d1dae93df0f597c1709c955e3857a5d Mon Sep 17 00:00:00 2001 From: Steven Hardy Date: Mon, 26 Jan 2015 18:44:21 +0000 Subject: Add a --no-activate option to disable device up/down actions Allows you to only install the config, but not take interfaces down/up. Useful if you wish to defer activation of a new config until a later time (e.g reboot). Change-Id: I42f3195e1d3d5d3b9d1c9dbb1f7cf1364503cbd3 --- os_net_config/cli.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'os_net_config/cli.py') diff --git a/os_net_config/cli.py b/os_net_config/cli.py index 955bb6f..c3a6358 100644 --- a/os_net_config/cli.py +++ b/os_net_config/cli.py @@ -67,6 +67,13 @@ def parse_opts(argv): help="Return the configuration commands, without applying them.", required=False) + parser.add_argument( + '--no-activate', + dest="no_activate", + action='store_true', + help="Install the configuration but don't start/stop interfaces.", + required=False) + parser.add_argument( '--cleanup', dest="cleanup", @@ -161,7 +168,8 @@ def main(argv=sys.argv): iface_json.update({'persist_mapping': persist_mapping}) obj = objects.object_from_json(iface_json) provider.add_object(obj) - files_changed = provider.apply(cleanup=opts.cleanup) + files_changed = provider.apply(cleanup=opts.cleanup, + activate=not opts.no_activate) if opts.noop: for location, data in files_changed.iteritems(): print "File: %s\n" % location -- cgit 1.2.3-korg