Help on the following Error.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.
Issue fixed . Json was located under ydk-gen/profiles/bundles/junos_profile.json but the command to generate api was ./generate.py --python --bundle profiles/junos_profile.json as is in the documentation. However when 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
Comments
0 comments
Please sign in to leave a comment.