Repository navigation
Closed
Labels
AluminiumRelease Post Mg and Pre SiLoaderRegressionThe issue is a bug that breaks functionality known to work in previous releases.bugbroken, incorrect, or confusing behaviorpoint-releaseminor releaseseverity-medium3rd level, incorrect or bad functionality, confusing and lacks a work around
Milestone
Description
Description
3003 broken pillar json serializable, works fine in 3002.6
Setup
default config.
Steps to Reproduce the behavior
example.sls
/etc/metadata:
file.managed:
- user: root
- group: root
- mode: 0644
- contents: |
{{pillar|json}}
Screenshots
local:
Data failed to compile:
----------
Rendering SLS 'base:base.metadata' failed: Jinja error: Object of type 'NamedLoaderContext' is not JSON serializable
Traceback (most recent call last):
File "/usr/lib/python3.6/site-packages/salt/utils/templates.py", line 497, in render_jinja_tmpl
output = template.render(**decoded_context)
File "/usr/lib/python3.6/site-packages/jinja2/environment.py", line 1090, in render
self.environment.handle_exception()
File "/usr/lib/python3.6/site-packages/jinja2/environment.py", line 832, in handle_exception
reraise(*rewrite_traceback_stack(source=source))
File "/usr/lib/python3.6/site-packages/jinja2/_compat.py", line 28, in reraise
raise value.with_traceback(tb)
File "<template>", line 15, in top-level template code
File "/usr/lib/python3.6/site-packages/salt/utils/jinja.py", line 936, in format_json
value, sort_keys=sort_keys, indent=indent
File "/usr/lib/python3.6/site-packages/salt/utils/json.py", line 149, in dumps
return json_module.dumps(obj, **kwargs) # future lint: blacklisted-function
File "/usr/lib64/python3.6/json/__init__.py", line 238, in dumps
**kw).encode(obj)
File "/usr/lib64/python3.6/json/encoder.py", line 199, in encode
chunks = self.iterencode(o, _one_shot=True)
File "/usr/lib64/python3.6/json/encoder.py", line 257, in iterencode
return _iterencode(o, 0)
File "/usr/lib64/python3.6/json/encoder.py", line 180, in default
o.__class__.__name__)
TypeError: Object of type 'NamedLoaderContext' is not JSON serializable
; line 15
---
[...]
file.managed:
- user: root
- group: root
- mode: 0644
- contents: |
{{pillar|json}} <======================
[...]
Versions Report
salt --versions-report
Salt Version:
Salt: 3003
Dependency Versions:
cffi: Not Installed
cherrypy: unknown
dateutil: Not Installed
docker-py: Not Installed
gitdb: Not Installed
gitpython: Not Installed
Jinja2: 2.11.1
libgit2: Not Installed
M2Crypto: 0.35.2
Mako: Not Installed
msgpack: 0.6.2
msgpack-pure: Not Installed
mysql-python: Not Installed
pycparser: Not Installed
pycrypto: 2.6.1
pycryptodome: Not Installed
pygit2: Not Installed
Python: 3.6.8 (default, Apr 2 2020, 13:34:55)
python-gnupg: Not Installed
PyYAML: 3.12
PyZMQ: 17.0.0
smmap: Not Installed
timelib: Not Installed
Tornado: 4.5.3
ZMQ: 4.1.4
System Versions:
dist: centos 7 Core
locale: UTF-8
machine: x86_64
release: 3.10.0-957.21.3.el7.x86_64
system: Linux
version: CentOS Linux 7 Core
Metadata
Metadata
Assignees
Labels
AluminiumRelease Post Mg and Pre SiLoaderRegressionThe issue is a bug that breaks functionality known to work in previous releases.bugbroken, incorrect, or confusing behaviorpoint-releaseminor releaseseverity-medium3rd level, incorrect or bad functionality, confusing and lacks a work around
Activity
welcome commentedon Apr 26, 2021
Hi there! Welcome to the Salt Community! Thank you for making your first contribution. We have a lengthy process for issues and PRs. Someone from the Core Team will follow up as soon as possible. In the meantime, here’s some information that may help as you continue your Salt journey.
Please be sure to review our Code of Conduct. Also, check out some of our community resources including:
There are lots of ways to get involved in our community. Every month, there are around a dozen opportunities to meet with other contributors and the Salt Core team and collaborate in real time. The best way to keep track is by subscribing to the Salt Community Events Calendar.
If you have additional questions, email us at [email protected]. We’re glad you’ve joined our community and look forward to doing awesome things with you!
OrangeDog commentedon Apr 27, 2021
As a workaround you can use
salt["pillar.raw"]()insteadsagetherage commentedon Apr 27, 2021
similar issue both could be reviewed at once #59361
dwoz commentedon May 11, 2021
I don't think #59361 is related.
9 remaining items
Fix pillar serialization for jinja saltstack#60083
Add changelog for saltstack#60083
Fix pillar serialization for jinja #60083
Add changelog for #60083
Fix pillar serialization for jinja saltstack#60083
Add changelog for saltstack#60083
Fix pillar serialization for jinja saltstack#60083
Add changelog for saltstack#60083
Fix pillar serialization for jinja saltstack#60083
Add changelog for saltstack#60083
Merge freeze into master (#60396)
Merge freeze into master (saltstack#60396)
Merge 3003.3 into master (#60924)