If the 'module' in the option --uml-no, then the attribute thismod-prefix is not defined, but it is still needed regardless of whether the module is shown as package in the UML or not.
This correction moves the definition of thismod-prefix out of the function emit_module_header() into the function emit() at the point where each module in the list of input modules is processed, immediately before the test for ctx_no_module and the call to emit_module_header().
This change can be tested by creating a UML from ietf-hardware with the option --uml-no=module.
Without this change pyang outputs the following:
If the 'module' in the option --uml-no, then the attribute thismod-prefix is not defined, but it is still needed regardless of whether the module is shown as package in the UML or not.
This correction moves the definition of thismod-prefix out of the function emit_module_header() into the function emit() at the point where each module in the list of input modules is processed, immediately before the test for ctx_no_module and the call to emit_module_header().
This change can be tested by creating a UML from ietf-hardware with the option --uml-no=module. Without this change pyang outputs the following:
These infos in the command line output are not correct as the leafrefs do not reference any node outside of the diagram.
With this change pyang outputs the following::