mbj4668 / pyang

An extensible YANG validator and converter in python
ISC License
528 stars 342 forks source link

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

Closed lexh147 closed 3 months ago

lexh147 commented 3 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 3 months ago

Closing as a duplicate of #884.