ansible-network / network-engine

This role provides the foundation for building network roles by providing modules and plugins that are common to all Ansible Network roles.
GNU General Public License v3.0
112 stars 53 forks source link

Fix relative path failure in command_parser #222

Closed trishnaguha closed 5 years ago

trishnaguha commented 5 years ago

Signed-off-by: Trishna Guha trishnaguha17@gmail.com Fixes https://github.com/ansible-network/network-engine/issues/152

The PR fixes the following issue: When playbook is in subdir and it is executed from parent dir, command_parser is unable to detect parser template path if the parser template is not present in the playbook dir and relative path for the template is given to src param.

For example: tguha@tguha ~/localtest $ tree

.
├── ansible.cfg
├── inventory
├── parser_templates
│   └── ios
│       └── show_interfaces.yaml
└── playbooks
    ├── parse.yaml

Playbook:

  - name: parse interfaces using command_parser engine
    command_parser:
      file: "../parser_templates/ios/show_interfaces.yaml"
      ...

Command used: ansible-playbook playbooks/parse.yaml

softwarefactory-project-zuul[bot] commented 5 years ago

Build failed.

trishnaguha commented 5 years ago

recheck

trishnaguha commented 5 years ago

cc @cidrblock

softwarefactory-project-zuul[bot] commented 5 years ago

Build failed.

trishnaguha commented 5 years ago

recheck

softwarefactory-project-zuul[bot] commented 5 years ago

Build failed.

trishnaguha commented 5 years ago

The tests are passing locally

PLAY RECAP ***************************************************************************************************************************************
localhost                  : ok=57   changed=0    unreachable=0    failed=0    skipped=0  
softwarefactory-project-zuul[bot] commented 5 years ago

Build failed.

pabelanger commented 5 years ago

recheck

pabelanger commented 5 years ago

recheck

softwarefactory-project-zuul[bot] commented 5 years ago

Build failed.

softwarefactory-project-zuul[bot] commented 5 years ago

Build succeeded.

softwarefactory-project-zuul[bot] commented 5 years ago

Build succeeded (gate pipeline).

trishnaguha commented 5 years ago

Backported to 2.6.10 #223 .