-
Notifications
You must be signed in to change notification settings - Fork 161
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enhancement to callback_plugins/jsnapy.py #250
Comments
The code change is now in pull request #252 |
There is a condition that my pull request deals with but the message may not be "the best", looking for comments/suggestions about changing the output message.
The RPC response won't match any xpath and can't be put in the JSNAPy error message as it is just:
After showing this test to the customer, they suggested "Test invalid for node." be printed, but I don't know if that will be 100% true. Should the message also say something about checking the RPC response file? |
Based on the discussion on #252 , closing this. |
Using jsnapy 1.2 to get fields from the updated test_results structure.
For my project I have made a change to jsnapy.py that tries to provide an 'operator friendly' output to running of jsnapy tests in Ansible and added a keyword to the junos_jsnapy module that controls whether you get error, or error+info messages from JSNAPy. Below is sample output generated by running a test playbook. Is there an interest for me to make this a pull request to the ansbile-junos-stdlib?
'reporting' is a var in my playbook and sets the value for "callback" on my modified junos_jsnapy module. Callback, if not set, leaves the old callback output, error gives only error messages from test, info gives both error and info messages.
The examples below do not show the 'coloring' the callback applies. "Results for:" header is Blue, and error messages are Red, all other text is b/w. "-- Test: " header comes from the rpc/cli that is executed (AKA the 'test_name' key for the list of results for that rpc/cli in the test_results json).
"Results for" and "Errors for" all come from 'test_name' key that is inside the test_name list. This is due to something like 'ping' may be executed multiple times for different destinations. Ping will only be a key in the test_results one time, but the list could have unique names for test_name if provided (look at error+info output below).
Running for errors:
$ ansible-playbook -i lab_role.inv -l lab-chi-spn02 test_run.pb.yml -e reporting=error
Running for errors+info:
$ ansible-playbook -i lab_role.inv -l lab-chi-spn02 test_run.pb.yml -e reporting=info
The text was updated successfully, but these errors were encountered: