07-18-2019 11:21 AM
Hi ,
I am trying to generate models from yang file using ydk-go.
Below error seeing
Traceback (most recent call last):
File "./generate.py", line 495, in <module>
output_directory = (generator.generate(options.bundle))
File "/root/ydk-gen/ydkgen/__init__.py", line 93, in generate
return self._generate_bundle(description_file)
File "/root/ydk-gen/ydkgen/__init__.py", line 123, in _generate_bundle
curr_bundle, all_bundles = resolver.resolve(tmp_file)
File "/root/ydk-gen/ydkgen/resolver/bundle_resolver.py", line 299, in resolve
self._resolve_bundles(root)
File "/root/ydk-gen/ydkgen/resolver/bundle_resolver.py", line 318, in _resolve_bundles
node = Bundle(self._resolve_bundle_file(d.uri),
File "/root/ydk-gen/ydkgen/resolver/bundle_resolver.py", line 369, in _resolve_bundle_file
resolved_file = self._resolve_file(src, self.cached_bundles_dir)
UnboundLocalError: local variable 'src' referenced before assignment
Command :
./generate.py --go --bundle /root/ydk-gen/profiles/bundles/ciscocfm_profile.json -o --output-directory /root/yangfiles/test2
I have attached the profiles for reference.
Appreciate your help on this.
07-19-2019 01:47 PM
Hello Rao
From the code it is clear that bundle profile does not set properly source of the yang models, which led to not handled error conditions. I will open a bug for this error. But on your side you need to build properly bundle profile. Here is a link to documentation on how to build the profile.
Please let me know if you need help.
Yan
07-19-2019 02:09 PM
Hi Yan,
I resolved all the dependencies but seeing below issue.
Error(s) occurred in YdkGenerator()!
Error occured: "/root/test2/.cache/models/tailf_ncs@16.9.3/tailf-ncs-devices.yang:1535: node tailf-ncs::connect is not found
/root/test2/.cache/models/tailf_ncs@16.9.3/tailf-ncs-devices.yang:1546: node tailf-ncs::sync-to is not found
/root/test2/.cache/models/tailf_ncs@16.9.3/tailf-ncs-devices.yang:1556: node tailf-ncs::sync-from is not found
/root/test2/.cache/models/tailf_ncs@16.9.3/tailf-ncs-devices.yang:1566: node tailf-ncs::disconnect is not found
/root/test2/.cache/models/tailf_ncs@16.9.3/tailf-ncs-devices.yang:1576: node tailf-ncs::check-sync is not found
/root/test2/.cache/models/tailf_ncs@16.9.3/tailf-ncs-devices.yang:1586: node tailf-ncs::check-yang-modules is not found
/root/test2/.cache/models/tailf_ncs@16.9.3/tailf-ncs-devices.yang:1597: node tailf-ncs::fetch-ssh-host-keys is not found
/root/test2/.cache/models/tailf_ncs@16.9.3/tailf-ncs-devices.yang:3644: node tailf-ncs::disconnect is not found
Can you please help on this?
Thanks,
Shanmukha Rao.
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: