Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue when display sensors with space in browser #2983

Closed
nicolargo opened this issue Oct 20, 2024 · 2 comments
Closed

Issue when display sensors with space in browser #2983

nicolargo opened this issue Oct 20, 2024 · 2 comments
Labels
Milestone

Comments

@nicolargo
Copy link
Owner

Related to #1289 (comment)

@nicolargo nicolargo added this to the Glances 4.3.0 milestone Oct 20, 2024
@nicolargo nicolargo added the bug label Oct 20, 2024
@nicolargo
Copy link
Owner Author

There is also an error if the sensor name contains a space.

Ex: columns=system:hr_name,load:min5,cpu:total,mem:percent,memswap:percent,sensors:value:Ambient 2

venv/bin/python -m glances -C conf/glances.conf --browser
Exception in thread Thread-4 (__update_stats):
Traceback (most recent call last):
  File "/usr/lib/python3.12/threading.py", line 1073, in _bootstrap_inner
    self.run()
  File "/usr/lib/python3.12/threading.py", line 1010, in run
    self._target(*self._args, **self._kwargs)
  File "/home/nicolargo/dev/glances/glances/servers_list.py", line 149, in __update_stats
    self.__update_stats_rest(f'{server['uri']}/api/{__apiversion__}', server)
  File "/home/nicolargo/dev/glances/glances/servers_list.py", line 221, in __update_stats_rest
    server[server_key] = r.json()[column['field']]
                         ~~~~~~~~^^^^^^^^^^^^^^^^^
KeyError: 'value'

@nicolargo
Copy link
Owner Author

Corrected for both '_' and space chars in the develop branch.

Will be release in Glances 4.3.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant