Skip to content

Commit d7d5ad8

Browse files
author
rsmekala
committed
Fixed junos_jsnapy callback plugin
- From Ansible 2.4, module_name is not passed as part of result to v2_runner_on_ok(). So, the current code return a Null object without adding the hosts. - Corrected by removing usage of module_name to add hosts in junos_jsnapy callback plugin.
1 parent 223b32f commit d7d5ad8

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

callback_plugins/jsnapy.py

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -31,25 +31,20 @@ def __init__(self):
3131

3232
def v2_runner_on_ok(self, result):
3333
"""
34-
Collect test results for all tests executed if module is junos_jsnapy
34+
Collect test results for all tests executed if action is snapcheck or check
3535
"""
3636

3737
## Extract module name
38-
module_name = ''
3938
module_args = {}
4039
if 'invocation' in result._result:
41-
if 'module_name' in result._result['invocation']:
42-
module_name = result._result['invocation']['module_name']
40+
if 'module_args' in result._result['invocation']:
4341
module_args = result._result['invocation']['module_args']
4442

4543
## Check if dic return has all valid information
46-
if module_name == '' or module_args == {}:
47-
return None
48-
elif 'action' not in module_args:
44+
if 'action' not in module_args:
4945
return None
5046

51-
if module_name == 'junos_jsnapy' and \
52-
( module_args['action'] == 'snapcheck' or module_args['action'] == 'check' ):
47+
if module_args['action'] == 'snapcheck' or module_args['action'] == 'check':
5348

5449
## Check if dict entry already exist for this host
5550
host = result._host.name

0 commit comments

Comments
 (0)