cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
778
Views
4
Helpful
1
Replies

ydkgen.common.YdkGenException: Path to description file is not valid.

Anton Abik
Level 4
Level 4

Hello guys,

can you please help me fix the error? I am trying to generate Junos yang model with ydk-gen. Json profile (stored in ~/.virtualenvs/ydk-gen/ydk-gen/profiles/bundles$) is configured as follows:

{

   "name":"junos",

   "version":"0.1.1",

   "ydk_version":"0.5.0",

   "author":"Junos",

   "copyright":"Junos",

   "description":"YDK Junos Profile",

   "models":{

       "file" : [

           "/profiles/bundles/yang/junos/configuration/configuration.yang"  

       ]

  }

}

ls from ydk-gen directory:

(ydk-py) labuser@TFI-LAB-SERVER-MGMT-01:~/.virtualenvs//ydk-gen/ydk-gen$ ls profiles/bundles/yang/junos/configuration/

configuration.yang

ERROR when trying to generate ydk-py:

./generate.py --python --bundle profile/junos_profile.json

Traceback (most recent call last):

  File "./generate.py", line 305, in <module>

    'bundle').generate(options.bundle))

  File "/home/labuser/.virtualenvs/ydk-gen/ydk-gen/ydkgen/__init__.py", line 87, in generate

    return self._generate_bundle(description_file)

  File "/home/labuser/.virtualenvs/ydk-gen/ydk-gen/ydkgen/__init__.py", line 105, in _generate_bundle

    _check_description_file(profile_file)

  File "/home/labuser/.virtualenvs/ydk-gen/ydk-gen/ydkgen/__init__.py", line 404, in _check_description_file

    raise YdkGenException('Path to description file is not valid.')

ydkgen.common.YdkGenException: Path to description file is not valid.

Thank you very much.

1 Accepted Solution

Accepted Solutions

Anton Abik
Level 4
Level 4

Ok I fixed this one. My json was located under ydk-gen/profiles/bundles/junos_profile.json but my command to generate api was ./generate.py --python --bundle profiles/junos_profile.json as is in the documentation. However I stored it exactly where other json profiles are (for example opencofig) and thats /profiles/bundles/ so the command should be:

./generate.py --python --bundle profiles/bundles/junos_profile.json

View solution in original post

1 Reply 1

Anton Abik
Level 4
Level 4

Ok I fixed this one. My json was located under ydk-gen/profiles/bundles/junos_profile.json but my command to generate api was ./generate.py --python --bundle profiles/junos_profile.json as is in the documentation. However I stored it exactly where other json profiles are (for example opencofig) and thats /profiles/bundles/ so the command should be:

./generate.py --python --bundle profiles/bundles/junos_profile.json

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: