add toml module#56615
Merged
Merged
Conversation
Contributor
Author
|
Looks like this may require adding the toml dependency. What's the appropriate way of marking that in the test suite? |
Contributor
Author
|
re-run pr-ubuntu1804-py3 |
1 similar comment
Contributor
Author
|
re-run pr-ubuntu1804-py3 |
Contributor
Author
|
Almost all working. Ubuntu seems pretty stuck with |
dwoz
approved these changes
Apr 26, 2020
myii
added a commit
to myii/ssf-formula
that referenced
this pull request
May 2, 2020
* https://tree.taiga.io/project/myii-saltstack-formulas/task/187 * https://travis-ci.org/github/myii/telegraf-formula/builds/681360474 (before) * https://travis-ci.org/github/myii/telegraf-formula/builds/682200993 (after) Quoting from Slack #testing channel: > Final issue with this test run: the `telegraf-formula` is failing > completely, due to `toml` issues: > https://travis-ci.org/github/myii/telegraf-formula/builds/681360474. > I'm vaguely aware that something has changed in this regard for Sodium, > so probably the formula needs to change? > > ``` > ID: telegraf/config/install > Function: file.managed > Name: /etc/telegraf/telegraf.conf > Result: False > Comment: Unable to manage file: Jinja error: module 'toml' has no attribute 'dumps' > Traceback (most recent call last): > File "/usr/local/lib/python3.7/dist-packages/salt/serializers/toml.py", line 63, in serialize > return toml.dumps(obj, **options) > AttributeError: module 'toml' has no attribute 'dumps' > > During handling of the above exception, another exception occurred: > > Traceback (most recent call last): > File "/usr/local/lib/python3.7/dist-packages/salt/utils/templates.py", line 400, in render_jinja_tmpl > output = template.render(**decoded_context) > File "/usr/local/lib/python3.7/dist-packages/jinja2/environment.py", line 1090, in render > self.environment.handle_exception() > File "/usr/local/lib/python3.7/dist-packages/jinja2/environment.py", line 832, in handle_exception > reraise(*rewrite_traceback_stack(source=source)) > File "/usr/local/lib/python3.7/dist-packages/jinja2/_compat.py", line 28, in reraise > raise value.with_traceback(tb) > File "<template>", line 6, in top-level template code > File "/usr/local/lib/python3.7/dist-packages/salt/modules/slsutil.py", line 224, in serialize > return _get_serialize_fn(serializer, "serialize")(obj, **kwargs) > File "/usr/local/lib/python3.7/dist-packages/salt/serializers/toml.py", line 65, in serialize > raise SerializationError(error) > salt.serializers.SerializationError: module 'toml' has no attribute 'dumps' > ``` > > --- > > toml update was to migrate from pytoml to toml library: > saltstack/salt#56615 > > Should have been a painless change, but I guess not. There weren't any > tests for the serializer, so I made one. If I get some spare time this > week, I'll see if I can take a look. There's not much to the serializer
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Leverages the existing toml serializer to add a toml renderer. Also updates the serializer from pytoml to the supported toml library.
What issues does this PR fix or reference?
Updated library fixes: #56323
Fixes: #14802
Previous Behavior
Serializer used old pytoml library and no toml renderer.
New Behavior
Now you can write salt states in toml:
Docs & changelog written?
Yes & No
Tests written?
Yes
Commits signed with GPG?
No