openconfig / public

Repository for publishing OpenConfig models, documentation, and other material for the community.
Apache License 2.0
875 stars 643 forks source link

Issue with when statement in openconfig-network-instance yang file #478

Open bhramidi opened 2 years ago

bhramidi commented 2 years ago

We are seeing an issue with the when statement with the latest network instance yang file.

https://github.com/openconfig/public/blob/e9e3a82693d1f26c61d7fbf85b3b2d0418d4af9e/release/models/network-instance/openconfig-network-instance.yang#L743

Line 743: the when statement should ideally be ‘when “./config/identifier = oc-pol-types:OSPF’ instead of just “./config/identifier =‘OSPF’ Same applies for all protocols (identifier types: BGP, ISIS, PIM etc.

We are seeing the following failure with when statement as it was expecting OSPF alone.

Sending:

#1595
<nc:rpc xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:fd37f28d-ef3f-4d93-89b2-4324103a228b"><nc:edit-config>
    <nc:target>
      <nc:running/>
    </nc:target>
    <nc:config>
      <network-instances xmlns="http://openconfig.net/yang/network-instance">
        <network-instance>
          <name>default</name>
          <config>
            <name>default</name>
          </config>
          <protocols>
            <protocol>
              <identifier xmlns:oc-pol-types="http://openconfig.net/yang/policy-types">oc-pol-types:OSPF</identifier>
              <name>1</name>
              <config>
                <identifier xmlns:oc-pol-types="http://openconfig.net/yang/policy-types">oc-pol-types:OSPF</identifier>
                <name>1</name>
              </config>
              <ospfv2>
                <areas>
                  <area>
                    <identifier>1</identifier>
                    <config>
                      <identifier>1</identifier>
                    </config>
                    <interfaces>
                      <interface>
                        <id>GigabitEthernet3</id>
                        <config>
                          <id>GigabitEthernet3</id>
                        </config>
                      </interface>
                    </interfaces>
                  </area>
                </areas>
              </ospfv2>
            </protocol>
          </protocols>
        </network-instance>
      </network-instances>
    </nc:config>
  </nc:edit-config>
</nc:rpc>

##
Received message from host
<?xml version="1.0" ?>
<rpc-reply message-id="urn:uuid:fd37f28d-ef3f-4d93-89b2-4324103a228b" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0">
  <rpc-error>

    <error-type>application</error-type>

    <error-tag>unknown-element</error-tag>

    <error-severity>error</error-severity>

    <error-path xmlns:oc-netinst="http://openconfig.net/yang/network-instance">
    /rpc/edit-config/config/oc-netinst:network-instances/oc-netinst:network-instance[oc-netinst:name='default']/oc-netinst:protocols/oc-netinst:protocol[oc-netinst:identifier='oc-pol-types:OSPF'][oc-netinst:name='1']/oc-netinst:ospfv2
  </error-path>
    <error-message xml:lang="en">/network-instances/network-instance[name='default']/protocols/protocol[identifier='oc-pol-types:OSPF'][name='1']/ospfv2: the 'when' expression &quot;./config/identifier = 'OSPF'&quot; failed</error-message>
    <error-info>
      <bad-element>ospfv2</bad-element>

    </error-info>

  </rpc-error>

</rpc-reply>

Even after changing the identifier to just "OSPF", we see the same issue. Could you please help us with this issue.

pullururajasekhar commented 2 years ago

Hi @aashaikh, @robshakir Could you please help resolve this issue quickly?

Thanks, Rajasekhar

sbarguil commented 2 years ago

The qualification prefixes has been added and now is pending to be published.

 when "./config/identifier = 'oc-pol-types:OSPF'" {
                description
                  "Include OSPFv2 parameters only when the protocol
                  is of type OSPFv2";
              }
            }
earies commented 2 years ago

@robshakir @aashaikh - it appears by the last comment this is likely resolved and also a pending PR https://github.com/openconfig/public/pull/482/files - when will this be published to public/master?

github-actions[bot] commented 1 month ago

This issue is stale because it has been open 180 days with no activity. If you wish to keep this issue active, please remove the stale label or add a comment, otherwise will be closed in 14 days.