Skip to content

Commit

Permalink
updates
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremyschulman committed Apr 9, 2014
1 parent 80e9ee3 commit ad2e322
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions lib/netconify/cmdo.py
Expand Up @@ -68,8 +68,7 @@ def _init_argsparser(self):
p.add_argument('--version', action='version', version=C.version )

## ------------------------------------------------------------------------
## Explicit controls to select the NOOB conf file, vs. netconify
## auto-detecting based on read parameters
## Device level options
## ------------------------------------------------------------------------

g = p.add_argument_group('DEVICE options')
Expand All @@ -78,6 +77,11 @@ def _init_argsparser(self):
dest='junos_conf_file',
help="Junos configuration file")

g.add_argument("--merge",
dest='junos_merge_conf',
help='load-merge conf file, default is overwrite',
action='store_true')

g.add_argument('--qfx-node',
dest='qfx_mode',
action='store_const', const=QFX_MODE_NODE,
Expand Down Expand Up @@ -343,7 +347,11 @@ def _push_config(self):

self._notify('conf','loading into device ...')
content = open(self._args.junos_conf_file,'r').read()
rc = self._tty.nc.load(content=content)
load_args = dict(content=content)
if self._args.junos_merge_conf is True:
load_args['action'] = 'replace' # merge/replace; yeah, I know ...
rc = self._tty.nc.load(**load_args)

if rc is not True:
self.results['failed'] = True
self.results['errmsg'] = 'failure to load configuration, aborting.'
Expand Down

0 comments on commit ad2e322

Please sign in to comment.