YangModels/yang

ietf-hardware yang module failed to install

Bijendra0508 opened this issue · 2 comments

Hello team,

I was trying to install o-ran-mplane yang module (which has dependency on ietf-hardware yang module) using below commands as a result o-ran-mplane yang installation failed with following erros.

root@embedded-PC:~# sysrepoctl --verbosity 3 --apply --install o-ran-mplane-int.yang -s ~/
[INF]: Applying scheduled changes.
[INF]: No scheduled changes.
[WRN]: Module's revisions are not unique (2018-06-28).
[ERR]: Invalid keyword "ianahw:sensor".
[ERR]: Module "ietf-hardware" parsing failed.
[ERR]: Importing "ietf-hardware" module into "o-ran-interfaces" failed.
[ERR]: Module "o-ran-interfaces" parsing failed.
[ERR]: Importing "o-ran-interfaces" module into "o-ran-mplane-int" failed.
[ERR]: Module "o-ran-mplane-int" parsing failed.
sysrepoctl error: Failed to install module "o-ran-mplane-int.yang" (libyang error)

Looking at logs it seems to me that there is some problem in ietf-hardware.yang module which i got from here

Please let me know how can i fix it. more details are posted on here

@Bijendra0508, the ietf-hardware.yang module parses fine for me with pyang:

$ pyang --lint -f tree ietf-hardware\@2018-03-13.yang
module: ietf-hardware
  +--rw hardware
     +--ro last-change?   yang:date-and-time
     +--rw component* [name]
        +--rw name              string
        +--rw class             identityref
        +--ro physical-index?   int32 {entity-mib}?
        +--ro description?      string
        +--rw parent?           -> ../../component/name
        +--rw parent-rel-pos?   int32
        +--ro contains-child*   -> ../../component/name
        +--ro hardware-rev?     string
        +--ro firmware-rev?     string
        +--ro software-rev?     string
        +--ro serial-num?       string
        +--ro mfg-name?         string
        +--ro model-name?       string
        +--rw alias?            string
        +--rw asset-id?         string
        +--ro is-fru?           boolean
        +--ro mfg-date?         yang:date-and-time
        +--rw uri*              inet:uri
        +--ro uuid?             yang:uuid
        +--rw state {hardware-state}?
        |  +--ro state-last-changed?   yang:date-and-time
        |  +--rw admin-state?          admin-state
        |  +--ro oper-state?           oper-state
        |  +--ro usage-state?          usage-state
        |  +--ro alarm-state?          alarm-state
        |  +--ro standby-state?        standby-state
        +--ro sensor-data {hardware-sensor}?
           +--ro value?               sensor-value
           +--ro value-type?          sensor-value-type
           +--ro value-scale?         sensor-value-scale
           +--ro value-precision?     sensor-value-precision
           +--ro oper-status?         sensor-status
           +--ro units-display?       string
           +--ro value-timestamp?     yang:date-and-time
           +--ro value-update-rate?   uint32

  notifications:
    +---n hardware-state-change
    +---n hardware-state-oper-enabled {hardware-state}?
    |  +--ro name?          -> /hardware/component/name
    |  +--ro admin-state?   -> /hardware/component/state/admin-state
    |  +--ro alarm-state?   -> /hardware/component/state/alarm-state
    +---n hardware-state-oper-disabled {hardware-state}?
       +--ro name?          -> /hardware/component/name
       +--ro admin-state?   -> /hardware/component/state/admin-state
       +--ro alarm-state?   -> /hardware/component/state/alarm-state

This suggests to me that there is some problem with the sysrepo YANG parser. Please check all your modules compile correctly with pyang, and if that reports any issues please come back here.

The comment on the thread you referenced to remove new lines indicates to me that whatever parser is being used by sysrepo may have issues with what is a legally formatted YANG model as the lines referred to:

https://github.com/YangModels/yang/blob/master/standard/ietf/RFC/ietf-hardware%402018-03-13.yang#L1006-L1007

...are in a valid format. there should be no need to reformat.

Cheers,

Einar

No further dialog for quite a while. Closing.