Skip to content
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

config_file and pyez_conn issue #671 #680

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

chidanandpujar
Copy link
Collaborator

@chidanandpujar chidanandpujar commented Jul 29, 2024

Fix for jsnapy module execution with combination of config_file and juniper.device.pyez , when test yaml files are copied under custom_directory .

when using custom_directory option dir, we have make sure that testfiles and snapshots directories are present under custom_dir.

ls jsnapy_TEST_FILES/testfiles/
test_chassis_alarms.yml

ls jsnapy_TEST_FILES/snapshots/
10.220.15.151_PRE_show_chassis_alarms.xml

  vars:
    JSNAPy_dir: "{{ playbook_dir }}/jsnapy_TEST_FILES"

    - name: "Collect Pre Snapshot"
      juniper.device.jsnapy:
        dir: "{{ JSNAPy_dir }}"
        config_file: jsnapy_main.yml
        logfile: "{{ tlogfile }}"
        action: "snap_pre"
      register: test_pre
      ignore_errors: true

cat jsnapy_TEST_FILES/jsnapy_main.yml
  tests:
    - test_chassis_alarms.yml

cat jsnapy_TEST_FILES/testfiles/test_chassis_alarms.yml 
tests_include:
 - test_chassis_alarm_check
# - test_chassis_alarm_check_collect_text

test_chassis_alarm_check:
  - command: show chassis alarms

cat jsnapy_TEST_FILES/snapshots/x.x.x.x_PRE_show_chassis_alarms.xml 
<alarm-information><alarm-summary><no-active-alarms/></alarm-summary></alarm-information>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant