Skip to content

address missing items ...#24

Open
kif wants to merge 1 commit intoskimpax:masterfrom
kif:master
Open

address missing items ...#24
kif wants to merge 1 commit intoskimpax:masterfrom
kif:master

Conversation

@kif
Copy link
Contributor

@kif kif commented Dec 19, 2025

I noticed random crashes because the web-request did not provide all information requested ...

Traceback (most recent call last):
  File "/usr/local/sbin/fbxosctrl.py", line 1371, in <module>
    rc = cli.dispatch(args)
         ^^^^^^^^^^^^^^^^^^
  File "/usr/local/sbin/fbxosctrl.py", line 1359, in dispatch
    return self._cmd_handlers.get(cmd, self._parser.print_help)()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/sbin/fbxosctrl.py", line 615, in get_system_info
    print(' - Model:     {}'.format(resp.result['model_info']['pretty_name']))
                                    ~~~~~~~~~~~^^^^^^^^^^^^^^
KeyError: 'model_info'

For this, I replaced most of the direct item access with [] with .get() which will print nothing instead of crashing.
Beside this, I also replaced some of the old-style formatting based on .format() with f-strings (not yet everywhere) and corrected the comparison to singletons like None, True & False with is instead of =.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant