02-20-2017 01:16 AM
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.
Solved! Go to Solution.
02-20-2017 02:37 AM
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
02-20-2017 02:37 AM
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
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide