cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
130
Views
0
Helpful
2
Replies
Highlighted
Cisco Employee

Error During generating module using ydk-go

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.

2 REPLIES 2
Cisco Employee

Re: Error During generating module using ydk-go

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

Cisco Employee

Re: Error During generating module using ydk-go

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.

Content for Community-Ad
August's Community Spotlight Awards