diff --git a/lib/ansible/module_utils/junos.py b/lib/ansible/module_utils/junos.py index dbdae283f1..4423816bd3 100644 --- a/lib/ansible/module_utils/junos.py +++ b/lib/ansible/module_utils/junos.py @@ -175,23 +175,12 @@ class Netconf(object): return ele def load_config(self, config, commit=False, replace=False, confirm=None, - comment=None, config_format='text', overwrite=False): - - if all([replace, overwrite]): - self.raise_exc('setting both replace and overwrite to True is invalid') + comment=None, config_format='text', overwrite=False, merge=False): + if (overwrite or replace) and config_format == 'set': + self.raise_exc('replace/overwrite cannot be True when config_format is `set`') if replace: merge = False - overwrite = False - elif overwrite: - merge = False - overwrite = True - else: - merge = True - overwrite = False - - if overwrite and config_format == 'set': - self.raise_exc('replace cannot be True when config_format is `set`') self.lock_config()