public icon indicating copy to clipboard operation
public copied to clipboard

Not able to compile openconfig-platform-transceiver yang

Open rdpravin1895 opened this issue 6 years ago • 4 comments

I am using confdc to compile the openconfig yangs. When trying to compile the openconfig-platform-transceiver yang, I get the following error:

openconfig-platform-transceiver.yang:476: error: the node 'transceiver' from module 'openconfig-platform-transceiver' (in node 'component' from 'openconfig-platform') is not found

The line corresponding to the error is:

augment "/oc-if:interfaces/oc-if:interface/oc-if:state" {
    //TODO: add 'when' or other condition to make sure this
    //leafref points to a component of type TRANSCEIVER.
    description
      "Adds a reference from the base interface to its corresponding
      physical channels.";

    leaf-list physical-channel {
      type leafref {
        path "/oc-platform:components/" +
          "oc-platform:component[oc-platform:name=current()/../oc-port:hardware-port]/" +
          "oc-transceiver:transceiver/" +
          "oc-transceiver:physical-channels/oc-transceiver:channel/" +
          "oc-transceiver:index";
      }
      description
        "For a channelized interface, list of references to the
        physical channels (lanes) corresponding to the interface.";
    }
  }

There is a container called 'transceiver' in the openconfig-platform-transceiver yang, but it is present inside the grouping 'port-transceiver-top'.

grouping port-transceiver-top {
    description
      "Top-level grouping for client port transceiver data";

    container transceiver {
      description
        "Top-level container for client port transceiver data";

      container config {
        description
          "Configuration data for client port transceivers";

        uses port-transceiver-config;
      }

      container state {

        config false;

        description
          "Operational state data for client port transceivers";

        uses port-transceiver-config;
        uses port-transceiver-state;
      }
      // physical channels are associated with a transceiver
      // component
      uses physical-channel-top;
    }
  }

This grouping is used in another augment statement.

augment "/oc-platform:components/oc-platform:component" {
    description
      "Adding transceiver data to physical inventory";

    uses port-transceiver-top {
      when "current()/oc-platform:state/" +
        "oc-platform:type = 'TRANSCEIVER'" {
        description
          "Augment is active when component is of type TRANSCEIVER";
      }
    }
  }

How to point to a leaf inside a grouping that is used in an augment statement? Is this the reason why the error is thrown?

rdpravin1895 avatar Jul 11 '18 06:07 rdpravin1895