Skip to content

Add a lookup plugin to return list of yang model in given dir that is imported by a given yang model #42

@ganeshrn

Description

@ganeshrn
SUMMARY

Currently the file option for get,configure and generate_spec modules accept a list of yang files that are required for converting JSON data to XML data and reverse. However, identifying the list of required yang files currently is based on going through yang files and identifying which all files in the given directory have imported the main yang file.

To help solve this the lookup plugin can accept the main yang model file path and an optional path to look for yang files that import the given main yang model. If the path is not provided look for all yang files in the current directory to identify which all yang models have imported the given yang model and return a list of yang files.

Example usage:

- name: get list of yang files which are depedent on openconfig-interfaces yang model 
  set_fact:
     oc_yang_files: "{{ lookup('~/yang_files/openconfig-interfaces.yang')}}"

- name: get list of yang files which are depedent on openconfig-interfaces yang model with optional search path for yang files
  set_fact:
     oc_yang_files: "{{ lookup('~/yang_files/openconfig-interfaces.yang', search_path='~/cisco/xr/yang')}}"
ISSUE TYPE
  • Feature Idea
COMPONENT NAME
ADDITIONAL INFORMATION

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions