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

Graph export is broken if there is no graph section in Glances configuration file #2839

Closed
nicolargo opened this issue Jun 17, 2024 · 1 comment
Labels
Milestone

Comments

@nicolargo
Copy link
Owner

nicolargo commented Jun 17, 2024

With Glances 4.0.8 and no [graph] section in glances.conf then:

./venv/bin/python -m glances --export graph --export-graph-path /tmp
Traceback (most recent call last):
  File "/usr/lib64/python3.9/runpy.py", line 197, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/lib64/python3.9/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/home/nhe/dev/glances/glances/__main__.py", line 17, in <module>
    glances.main()
  File "/home/nhe/dev/glances/glances/__init__.py", line 173, in main
    start(config=core.get_config(), args=core.get_args())
  File "/home/nhe/dev/glances/glances/__init__.py", line 102, in start
    mode = GlancesMode(config=config, args=args)
  File "/home/nhe/dev/glances/glances/standalone.py", line 42, in __init__
    self.stats = GlancesStats(config=config, args=args)
  File "/home/nhe/dev/glances/glances/stats.py", line 39, in __init__
    self.load_modules(self.args)
  File "/home/nhe/dev/glances/glances/stats.py", line 90, in load_modules
    self.load_exports(args=args)
  File "/home/nhe/dev/glances/glances/stats.py", line 214, in load_exports
    self._exports[exporter_name] = export_module.Export(args=args, config=self.config)
  File "/home/nhe/dev/glances/glances/exports/glances_graph/__init__.py", line 37, in __init__
    self.generate_every = int(getattr(self, 'generate_every', 0))
TypeError: int() argument must be a string, a bytes-like object or a number, not 'NoneType'

Default value should be set for generate_every, path and size.

@nicolargo nicolargo added this to the Glances 4.1.0 milestone Jun 17, 2024
@nicolargo nicolargo changed the title Graph export is broken Graph export is broken if there is no graph section in Glances configuration file Jun 17, 2024
@nicolargo
Copy link
Owner Author

Corrected in develop branch.

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