You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
And thus, only .yaml files are loaded, while the docs says any YAML or JSON file works.
I found out the hard way spending a lot of time trying to figure out why my .yml was only loaded if named explicitly.
Same as last time, I'll gladly work on a PR but we're still trying to figure out how to consistently sign CLAs company-wide. I hope to get this sorted by mid-January
What did you expect?
Any json/yml/yaml file would be loaded.
Ideally, all files would be loaded and tested for any of those 2 formats before being read or not.
Relevant log output
slo_generator.utils - DEBUG - Path '/etc/config/slos' not found. Trying to load from string
slo_generator.utils - ERROR - Error serializing config into dict. This might be due to a syntax error in the YAML / JSON config file.
slo_generator.utils - DEBUG - '/etc/config/slos'
Code of Conduct
I agree to follow this project's Code of Conduct
The text was updated successfully, but these errors were encountered:
I agree there is a discrepancy between what the doc says and what the code actually does. On top of that, get_files() looks for files whose extensions is one of yaml, yml or json. I understand it can be confusing.
I never noticed this error myself as I only use YAML files. I find them less verbose and more readable than JSON. This being said, there is no reason for not supporting JSON files if the doc says so.
Please let me know how the signing of the CLA goes. I can move forward on my own with the PR if fixing this behavior is both urgent and important.
No urgency on my side, as the simple workaround was to have .yaml files so a simple renaming worked.
I'll try myself at the PR if you don't mind as soon as the CLA is signed.
SLO Generator Version
2.3.3
Python Version
3.7.7
What happened?
When Loading SLOs from a directory (
compute -f /etc/cronfig/slos -c config.yaml
), this code is executed :https://github.com/google/slo-generator/blob/master/slo_generator/utils.py#L64
And thus, only
.yaml
files are loaded, while the docs says any YAML or JSON file works.I found out the hard way spending a lot of time trying to figure out why my
.yml
was only loaded if named explicitly.Same as last time, I'll gladly work on a PR but we're still trying to figure out how to consistently sign CLAs company-wide. I hope to get this sorted by mid-January
What did you expect?
Any json/yml/yaml file would be loaded.
Ideally, all files would be loaded and tested for any of those 2 formats before being read or not.
Relevant log output
Code of Conduct
The text was updated successfully, but these errors were encountered: