From 7a19e16dca7fc378ff288b39f0d9c79322179b20 Mon Sep 17 00:00:00 2001 From: Peter Sprygada Date: Sat, 20 Feb 2016 15:58:19 -0500 Subject: [PATCH] minor bugfixes for junos_config return values The junos_config now properly returns updates and reponses --- network/junos/junos_config.py | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/network/junos/junos_config.py b/network/junos/junos_config.py index 5b5daf57809..ef7a5f0419b 100644 --- a/network/junos/junos_config.py +++ b/network/junos/junos_config.py @@ -82,19 +82,17 @@ EXAMPLES = """ """ RETURN = """ - -lines: +updates: description: The set of commands that will be pushed to the remote device returned: always type: list sample: ['...', '...'] -response: +responses: description: The set of responses from issuing the commands on the device returned: always type: list sample: ['...', '...'] - """ import re import itertools @@ -137,7 +135,6 @@ def main(): config = to_lines(parsed) result = dict(changed=False) - result['_config'] = config candidate = list() for line in lines: @@ -158,8 +155,6 @@ def main(): candidate.append(line) break - - if candidate: if before: candidate[:0] = before @@ -169,10 +164,10 @@ def main(): if not module.check_mode: response = module.configure(candidate) - result['response'] = response + result['responses'] = response result['changed'] = True - result['lines'] = candidate + result['updates'] = candidate return module.exit_json(**result) from ansible.module_utils.basic import *