mbj4668 / pyang

An extensible YANG validator and converter in python
ISC License
537 stars 344 forks source link

Tree: "module:" header missing when passing multiple modules #894

Closed lexh147 closed 7 months ago

lexh147 commented 7 months ago

Hello team,

Until 2.5.3 included, when passing multiple modules to -f tree each module name was printed and prefixed with module::

% pyang --version
pyang 2.5.3

% pyang -f tree ietf-interfaces.yang ietf-interfaces-ext.yang
module: ietf-interfaces
  +--rw interfaces
  |  +--rw interface* [name]
  |     +--rw name                        string
  |     +--rw description?                string
[...]
           +--ro out-discards?         yang:counter32
           +--ro out-errors?           yang:counter32

module: ietf-interfaces-ext

  augment /if:interfaces-state/if:interface/if:statistics:
    +--ro in-pkts?    yang:counter64
    +--ro out-pkts?   yang:counter64

Now with 2.6.0, it is only printed for the first module, but not for the subsequent ones:

% pyang --version
pyang 2.6.0

% pyang -f tree ietf-interfaces.yang ietf-interfaces-ext.yang
module: ietf-interfaces
  +--rw interfaces
  |  +--rw interface* [name]
  |     +--rw name                        string
  |     +--rw description?                string
[...]
           +--ro out-discards?         yang:counter32
           +--ro out-errors?           yang:counter32

  augment /if:interfaces-state/if:interface/if:statistics:
    +--ro in-pkts?    yang:counter64
    +--ro out-pkts?   yang:counter64
mbj4668 commented 7 months ago

Closing as a duplicate of #884.