diff options
author | Steven Hardy <shardy@redhat.com> | 2015-01-26 18:44:21 +0000 |
---|---|---|
committer | Steven Hardy <shardy@redhat.com> | 2015-03-05 13:11:09 +0000 |
commit | 3304fa066d1dae93df0f597c1709c955e3857a5d (patch) | |
tree | b5347080f433cdc99b0b8e1f386b7bb5437ae09f /os_net_config/cli.py | |
parent | 4cf8c1a0fd3c029ea81092a8901d786bfce77735 (diff) |
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
Diffstat (limited to 'os_net_config/cli.py')
-rw-r--r-- | os_net_config/cli.py | 10 |
1 files changed, 9 insertions, 1 deletions
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 @@ -68,6 +68,13 @@ def parse_opts(argv): 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", action='store_true', @@ -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 |