Skip to content
This repository has been archived by the owner on Apr 10, 2024. It is now read-only.

YAMLLoadWarning: calling yaml.load() without Loader=... is deprecated #2

Open
olberger opened this issue Jan 5, 2023 · 2 comments
Open

Comments

@olberger
Copy link

olberger commented Jan 5, 2023

I installed yunomonitor inside a YNH server running 11.1.1.2, and got nothing really happening. Investigating the timer service I checked to run it manually and got:

root@ynh:/opt/yunomonitor# /opt/yunomonitor/yunomonitor.py -c /opt/yunomonitor/conf/yunomonitor.yml
/opt/yunomonitor/yunomonitor.py:321: YAMLLoadWarning: calling yaml.load() without Loader=... is deprecated, as the default Loader is unsafe. Please read https://msg.pyyaml.org/load for full details.
  config = yaml.load(local_config_file)
INFO:root:CHECKING EACH SERVERS...
INFO:root:[localhost] CONFIGURING...
/opt/yunomonitor/yunomonitor.py:747: YAMLLoadWarning: calling yaml.load() without Loader=... is deprecated, as the default Loader is unsafe. Please read https://msg.pyyaml.org/load for full details.
  app_settings = yaml.load(settings_file)
Exception in thread Thread-1:
Traceback (most recent call last):
  File "/usr/lib/python3.9/threading.py", line 954, in _bootstrap_inner
    self.run()
  File "/opt/yunomonitor/yunomonitor.py", line 448, in run
    self.ynh_maps[self.server] = self._load_monitoring_config()
  File "/opt/yunomonitor/yunomonitor.py", line 488, in _load_monitoring_config
    config = generate_monitoring_config()
  File "/opt/yunomonitor/yunomonitor.py", line 778, in generate_monitoring_config
    "label": app_settings['label'],
KeyError: 'label'
INFO:root:FILTERING...
INFO:root:MAILING...

Hope this helps,

@olberger
Copy link
Author

olberger commented Jan 5, 2023

It seems one may get rid of the warnings by replacing load() by safe_load()...

But then, back to :

/opt/yunomonitor/yunomonitor.py -c /opt/yunomonitor/conf/yunomonitor.yml
INFO:root:CHECKING EACH SERVERS...
INFO:root:[localhost] CONFIGURING...
Exception in thread Thread-1:
Traceback (most recent call last):
  File "/usr/lib/python3.9/threading.py", line 954, in _bootstrap_inner
    self.run()
  File "/opt/yunomonitor/yunomonitor.py", line 448, in run
    self.ynh_maps[self.server] = self._load_monitoring_config()
  File "/opt/yunomonitor/yunomonitor.py", line 488, in _load_monitoring_config
    config = generate_monitoring_config()
  File "/opt/yunomonitor/yunomonitor.py", line 778, in generate_monitoring_config
    "label": app_settings['label'],
KeyError: 'label'
INFO:root:FILTERING...
INFO:root:MAILING...

olberger added a commit to olberger/yunomonitor that referenced this issue Jan 5, 2023
@olberger
Copy link
Author

olberger commented Jan 5, 2023

It seems one may get rid of the warnings by replacing load() by safe_load()...

But then, back to :

/opt/yunomonitor/yunomonitor.py -c /opt/yunomonitor/conf/yunomonitor.yml
INFO:root:CHECKING EACH SERVERS...
INFO:root:[localhost] CONFIGURING...
Exception in thread Thread-1:
Traceback (most recent call last):
  File "/usr/lib/python3.9/threading.py", line 954, in _bootstrap_inner
    self.run()
  File "/opt/yunomonitor/yunomonitor.py", line 448, in run
    self.ynh_maps[self.server] = self._load_monitoring_config()
  File "/opt/yunomonitor/yunomonitor.py", line 488, in _load_monitoring_config
    config = generate_monitoring_config()
  File "/opt/yunomonitor/yunomonitor.py", line 778, in generate_monitoring_config
    "label": app_settings['label'],
KeyError: 'label'
INFO:root:FILTERING...
INFO:root:MAILING...

OK, I guess that one is another beast : apps having no labels ? Fill handle in a separate issue

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

No branches or pull requests

1 participant