01-06-2020 09:47 AM
I’ve hit this problem when getting the config of a IOS-XR 6.6.3 (YDK classes are for 6.6.2), it seems that YDK is not working well with the class 'Snmp' from module 'Cisco_IOS_XR_snmp_agent_cfg'. The 6.6.3 is supposed to be only bug fixes of 6.6.2 (I heard).
Is this a known issue ?
…
provider = NetconfServiceProvider(address=data['router'],
port=830,
username=data['usr'],
password=data['pass'],
protocol="ssh")
netconf = NetconfService()
conf=netconf.get_config(provider, Datastore.running)
pp.pprint(conf.keys())
This code produces the following error in ‘ydk’ log:
2020-01-06 14:29:44,375 - ydk - INFO - ============= Sending RPC to device =============
<rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"><get-config xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
<source>
<running/>
</source>
</get-config>
</rpc>
2020-01-06 14:29:46,352 - ydk - INFO - ============= Received RPC from device =============
<?xml version="1.0"?>
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="1">
<data>
…
</vrf>
</netconf-vrf-table>
</server>
</ssh>
</data>
</rpc-reply>
2020-01-06 14:29:46,776 - ydk - ERROR - Failed instantiate class 'Snmp' from module 'Cisco_IOS_XR_snmp_agent_cfg'
2020-01-06 14:30:12,629 - ydk - INFO - Disconnected from device
All other classes found in the config looked OK, (notice the missing class 'Cisco-IOS-XR-snmp-agent-cfg:snmp' in the list) :
[ 'Cisco-IOS-XR-ip-domain-cfg:ip-domain',
'Cisco-IOS-XR-snmp-agent-cfg:mib',
'Cisco-IOS-XR-ip-ntp-cfg:ntp',
'Cisco-IOS-XR-ipv4-filesystems-cfg:ftp',
'Cisco-IOS-XR-infra-infra-clock-linux-cfg:clock',
'Cisco-IOS-XR-man-netconf-cfg:netconf-yang',
'Cisco-IOS-XR-infra-rsi-cfg:vrfs',
'Cisco-IOS-XR-ip-static-cfg:router-static',
'Cisco-IOS-XR-ip-tcp-cfg:ip-tcp',
'Cisco-IOS-XR-ip-tcp-cfg:ip',
'Cisco-IOS-XR-ipv4-acl-cfg:ipv4-acl-and-prefix-list',
'Cisco-IOS-XR-tty-server-cfg:tty',
'Cisco-IOS-XR-infra-syslog-cfg:syslog-service',
'Cisco-IOS-XR-infra-syslog-cfg:syslog',
'Cisco-IOS-XR-ip-iarm-cfg:ip-arm',
'Cisco-IOS-XR-policy-repository-cfg:routing-policy',
'Cisco-IOS-XR-tty-vty-cfg:vty',
'Cisco-IOS-XR-infra-infra-cfg:banners',
'Cisco-IOS-XR-call-home-cfg:call-home',
'Cisco-IOS-XR-ifmgr-cfg:interface-configurations',
'Cisco-IOS-XR-lib-mpp-cfg:control-plane',
'Cisco-IOS-XR-ip-bfd-cfg:bfd',
'Cisco-IOS-XR-aaa-lib-cfg:aaa',
'Cisco-IOS-XR-ipv4-bgp-cfg:bgp',
'Cisco-IOS-XR-shellutil-cfg:host-names',
'Cisco-IOS-XR-infra-policymgr-cfg:policy-manager',
'Cisco-IOS-XR-crypto-ssh-cfg:ssh']
Any ideas ?
Solved! Go to Solution.
01-08-2020 12:10 PM
My investigation of this issue showed that it appears due to use of 'entity' node name in the YANG model, which confuses YDK generated bundle code. I have opened YDK GitHub issue to track this error.
As a workaround I suggest to use explicit filters for device query and not to use the Cisco_IOS_XR_snmp_agent_cfg.Snmp class
01-08-2020 12:10 PM
My investigation of this issue showed that it appears due to use of 'entity' node name in the YANG model, which confuses YDK generated bundle code. I have opened YDK GitHub issue to track this error.
As a workaround I suggest to use explicit filters for device query and not to use the Cisco_IOS_XR_snmp_agent_cfg.Snmp class
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: