cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
442
Views
0
Helpful
0
Replies

get-schema - nxos - always return module Cisco-NX-OS-device

hjensas
Level 1
Level 1

Hi,

 

I'm using Cisco 9500v virtual switch in a KVM virtual machine, details from `show version`:

Nexus 9000v is a demo version of the Nexus Operating System

Software
  BIOS: version
  NXOS: version 10.2(2) [Feature Release]
  BIOS compile time:
  NXOS image file is: bootflash:///nxos64-cs.10.2.2.F.bin
  NXOS compile time:  12/14/2021 23:00:00 [12/15/2021 11:59:34]

Hardware
  cisco Nexus9000 C9500v Chassis ("Supervisor Module")
  Intel Core Processor (Skylake, IBRS) with 12273672 kB of memory.
  Processor Board ID 9KFQI9MZKOE
  Device name: switch
  bootflash:    4287040 kB

I activated openconfig moduels by running `install activate mtx-openconfig-all` and I can see lots of openconfig modules in capabilities.

$ ssh -i netconf -s netconf@192.168.24.21 -p 830 netconf
<?xml version="1.0" encoding="UTF-8"?> <hello xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"> <capabilities> <capability>urn:ietf:params:netconf:base:1.0</capability> <capability>urn:ietf:params:netconf:base:1.1</capability> <-- SNIP --> <capability>http://openconfig.net/yang/interfaces?revision=2019-11-19&amp;module=openconfig-interfaces&amp;deviations=cisco-nx-openconfig-interfaces-deviations</capability> <-- SNIP -->
</capabilities> <session-id>952341788</session-id> </hello>

 

I wrote this test script to extract module `openconfig-interfaces` yang document:

with manager.connect(**device) as m:
    schema = m.get_schema('openconfig-interfaces')
    with open('/root/netconf-examples/openconfig-interfaces.yang', 'w') as f:
        f.write(schema.data)

 

The code run without error. But, the resulting yang is not the correct module.

No matter what identified I provide get_schema() it will return the `Cisco-NX-OS-device` module.

$ head -n 8 openconfig-interfaces.yang 
module Cisco-NX-OS-device {
    yang-version 1;
    namespace "http://cisco.com/ns/yang/cisco-nx-os-device";
    prefix top;
    organization "Cisco Systems, Inc.";
    contact " Cisco Systems, Inc., Customer Service, Postal: 170 W Tasman Drive, San Jose, CA 95134, Tel: +1 800 553-NETS, e-mail: cs-yang@cisco.com";
    description "NXOS Device YANG Model";
    reference "101c510e055a9240f03d2219ab4f027848e946d4";

 

NOTE:

 - If I give it an invalid module identifier, `RPCError: Identifier is not valid` is raised.

 - All valid identifier the returned yang document is always the `Cisco-NX-OS-device` module.

 - Other operations using `openconfig-interfaces` such as retrieving and setting configuration works.

 

Why is the device returning the incorrect yang documents?

Is there anything I may have missed to configure?

 

0 Replies 0