06-09-2018 09:48 AM
Hi !
I tried to run test code with purpose to fetch configuration from device
I used netconf service (both "get" and "get_config" operations), but face an issue
In log I could see messages like:
Can't find data tag in reply sent by device
<requested-device configuration>
...
...
...
</requested-device-configuration>
and
Traceback (most recent call last):
File "3.py", line 30, in <module>
configuration = netconf.get(provider, configuration)
File "/usr/local/lib/python2.7/dist-packages/ydk/services/netconf_service.py", line 133, in get
result = self._ns.get(provider, filters)
File "/usr/lib/python2.7/contextlib.py", line 35, in __exit__
self.gen.throw(type, value, traceback)
File "/usr/local/lib/python2.7/dist-packages/ydk/errors/error_handler.py", line 82, in handle_runtime_error
_raise(_exc)
File "/usr/local/lib/python2.7/dist-packages/ydk/errors/error_handler.py", line 56, in _raise
raise exc
ydk.errors.YServiceProviderError:
<requested-device configuration>
...
...
...
</requested-device-configuration>
Test code in attachement
Could you please help to understand, what am I doing wrong or what could be a reason of an issue ?
Thanks !
06-11-2018 10:14 AM
The last line of your script seems to be missing a parameter (see docs):
configuration = junos_configuration.Configuration() read_configuration = netconf.get_config(provider, Datastore.running, configuration)
Also can you please includes any logs you are seeing?
06-11-2018 12:29 PM
Hi, Abhirame !
I ran 2 samples of code. Both considers your recommendation, one of them contains "filter" argument, another not (samples and logs in attachment).
In both cases, log written using standard python logging contains "Can't find data tag in reply sent by device"
and such message is given in shell
Traceback (most recent call last):
File "filter_undefined.py", line 30, in <module>
read_configuration = netconf.get_config(provider, Datastore.running)
File "/usr/local/lib/python2.7/dist-packages/ydk/services/netconf_service.py", line 108, in get_config
return _read_entities(provider, True, source)
File "/usr/lib/python2.7/contextlib.py", line 35, in __exit__
self.gen.throw(type, value, traceback)
File "/usr/local/lib/python2.7/dist-packages/ydk/errors/error_handler.py", line 82, in handle_runtime_error
_raise(_exc)
File "/usr/local/lib/python2.7/dist-packages/ydk/errors/error_handler.py", line 56, in _raise
raise exc
ydk.errors.YServiceProviderError: // full_device_configuration_in_xml_format
Thanks!
06-11-2018 01:47 PM
Created an issue for this:
06-11-2018 03:21 PM
OK, Thanks !
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: