Update junos cliconf plugin (#43643)

* Update junos cliconf plugin

Fixes #39056

Refactor junos cliconf plugin api and other
minor changes

* Fix CI issue

* Fix CI failure
This commit is contained in:
Ganesh Nalawade 2018-08-06 10:08:05 +05:30 committed by GitHub
commit 35adc12c38
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 146 additions and 28 deletions

View file

@ -149,11 +149,11 @@ def map_params_to_obj(module):
def load_config(module, config, commit=False):
conn = get_connection(module)
try:
conn.edit_config(to_list(config) + ['top'])
diff = conn.compare_configuration()
resp = conn.edit_config(to_list(config) + ['top'])
except ConnectionError as exc:
module.fail_json(msg=to_text(exc, errors='surrogate_then_replace'))
diff = resp.get('diff', '')
if diff:
if commit:
commit_configuration(module)