zhmcclient / zhmccli

A CLI for the IBM Z HMC
Apache License 2.0
10 stars 9 forks source link

KeyError on 'description' in "zhmc passwordrule characterrule list" command #552

Closed andy-maier closed 9 months ago

andy-maier commented 9 months ago
# zhmc passwordrule characterrule list ZaaS
Traceback (most recent call last):
  File "/usr/local/bin/zhmc", line 8, in <module>
    sys.exit(cli())
  File "/usr/local/lib/python3.10/dist-packages/click/core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python3.10/dist-packages/click/core.py", line 1078, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python3.10/dist-packages/click/core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python3.10/dist-packages/click/core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python3.10/dist-packages/click/core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python3.10/dist-packages/click/core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python3.10/dist-packages/click/core.py", line 783, in invoke
    return __callback(*args, **kwargs)
  File "/usr/local/lib/python3.10/dist-packages/click/decorators.py", line 45, in new_func
    return f(get_current_context().obj, *args, **kwargs)
  File "/usr/local/lib/python3.10/dist-packages/zhmccli/_cmd_character_rule.py", line 53, in character_rule_list
    cmd_ctx.execute_cmd(lambda: cmd_character_rule_list(cmd_ctx, password_rule))
  File "/usr/local/lib/python3.10/dist-packages/zhmccli/_helper.py", line 390, in execute_cmd
    cmd()  # The zhmc command function call.
  File "/usr/local/lib/python3.10/dist-packages/zhmccli/_cmd_character_rule.py", line 53, in <lambda>
    cmd_ctx.execute_cmd(lambda: cmd_character_rule_list(cmd_ctx, password_rule))
  File "/usr/local/lib/python3.10/dist-packages/zhmccli/_cmd_character_rule.py", line 214, in cmd_character_rule_list
    print_dicts(cmd_ctx, character_rules, cmd_ctx.output_format,
  File "/usr/local/lib/python3.10/dist-packages/zhmccli/_helper.py", line 629, in print_dicts
    print_dicts_as_table(
  File "/usr/local/lib/python3.10/dist-packages/zhmccli/_helper.py", line 824, in print_dicts_as_table
    value = _dict[name]
KeyError: 'description'
andy-maier commented 9 months ago

The characterrule item does not have a description property. This bug was introduced with PR https://github.com/zhmcclient/zhmccli/pull/471 and released first in version 1.9.0.