minor bugfixes for junos_config return values

The junos_config now properly returns updates and reponses
This commit is contained in:
Peter Sprygada 2016-02-20 15:58:19 -05:00
parent 7901f54140
commit 7a19e16dca

View file

@ -82,19 +82,17 @@ EXAMPLES = """
""" """
RETURN = """ RETURN = """
updates:
lines:
description: The set of commands that will be pushed to the remote device description: The set of commands that will be pushed to the remote device
returned: always returned: always
type: list type: list
sample: ['...', '...'] sample: ['...', '...']
response: responses:
description: The set of responses from issuing the commands on the device description: The set of responses from issuing the commands on the device
returned: always returned: always
type: list type: list
sample: ['...', '...'] sample: ['...', '...']
""" """
import re import re
import itertools import itertools
@ -137,7 +135,6 @@ def main():
config = to_lines(parsed) config = to_lines(parsed)
result = dict(changed=False) result = dict(changed=False)
result['_config'] = config
candidate = list() candidate = list()
for line in lines: for line in lines:
@ -158,8 +155,6 @@ def main():
candidate.append(line) candidate.append(line)
break break
if candidate: if candidate:
if before: if before:
candidate[:0] = before candidate[:0] = before
@ -169,10 +164,10 @@ def main():
if not module.check_mode: if not module.check_mode:
response = module.configure(candidate) response = module.configure(candidate)
result['response'] = response result['responses'] = response
result['changed'] = True result['changed'] = True
result['lines'] = candidate result['updates'] = candidate
return module.exit_json(**result) return module.exit_json(**result)
from ansible.module_utils.basic import * from ansible.module_utils.basic import *