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

(Re)consider conditional yaml dump #88

Open
sed-i opened this issue Oct 4, 2022 · 0 comments
Open

(Re)consider conditional yaml dump #88

sed-i opened this issue Oct 4, 2022 · 0 comments

Comments

@sed-i
Copy link
Contributor

sed-i commented Oct 4, 2022

The charm is being (overly?) smart about relation data:

if config:
yaml_config = yaml.dump(config) if not isinstance(config, str) else config

The charm lib isn't:

app_databag["config"] = yaml.safe_dump(config)

For consistency, consider:

-        app_databag['config'] = yaml.safe_dump(config)
+        app_databag['config'] = yaml.safe_dump(config) if not isinstance(config, str) else config
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants