summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Sprygada <privateip@users.noreply.github.com>2016-09-28 14:36:53 -0400
committerGitHub <noreply@github.com>2016-09-28 14:36:53 -0400
commit98546444316f8cbfe7e51f57a2026a58e786d814 (patch)
treed8bba70c2e5ee2bfa02f4cc823ab9cdb11168a40
parent4452ee86bdb952faa59cf0125245e433bc298fed (diff)
downloadansible-98546444316f8cbfe7e51f57a2026a58e786d814.tar.gz
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.
-rw-r--r--lib/ansible/module_utils/junos.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/ansible/module_utils/junos.py b/lib/ansible/module_utils/junos.py
index 9cf36da4ce..94f2647de4 100644
--- a/lib/ansible/module_utils/junos.py
+++ b/lib/ansible/module_utils/junos.py
@@ -171,11 +171,17 @@ class Netconf(object):
return ele
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:
merge = False
- overwrite = True
+ overwrite = False
+ elif overwrite:
+ merge = True
+ overwrite = False
else:
merge = True
overwrite = False