mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-27 15:11:23 -07:00
adds overwrite kwarg to load_config in junos (#17798)
The junos load_config() method supports operations of overwrite, replace and merge. This adds the missing overwrite keyword arg to load_config() so that action in junos_template can be procesed correctly.
This commit is contained in:
parent
4452ee86bd
commit
9854644431
1 changed files with 8 additions and 2 deletions
|
@ -171,11 +171,17 @@ class Netconf(object):
|
||||||
return ele
|
return ele
|
||||||
|
|
||||||
def load_config(self, config, commit=False, replace=False, confirm=None,
|
def load_config(self, config, commit=False, replace=False, confirm=None,
|
||||||
comment=None, config_format='text'):
|
comment=None, config_format='text', overwrite=False):
|
||||||
|
|
||||||
|
if all([replace, overwrite]):
|
||||||
|
self.raise_exc('setting both replace and overwrite to True is invalid')
|
||||||
|
|
||||||
if replace:
|
if replace:
|
||||||
merge = False
|
merge = False
|
||||||
overwrite = True
|
overwrite = False
|
||||||
|
elif overwrite:
|
||||||
|
merge = True
|
||||||
|
overwrite = False
|
||||||
else:
|
else:
|
||||||
merge = True
|
merge = True
|
||||||
overwrite = False
|
overwrite = False
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue