-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Multiple issues with Saltclass variable expansion #48170
Comments
Cc: @olivier-mauras |
@max-arnold this has been reported in #47634 PR has been merged For hard fail I disagree with that, but you can open an issue for it so we can discuss that point. Now having an option to hard fail on missing class/variable sounds fair to me |
Unfortunately, I can't test this with the latest develop branch. It fails with the following exception:
|
Also, is it normal that during First invocation
Second invocation
|
@olivier-mauras This
|
I asked a question on SaltStack Slack group regarding this double call. It seems to be ok:
|
ping @olivier-mauras can you take a look here |
Yes but sadly I can't reproduce it :( |
@olivier-mauras Sorry, my previous example was incomplete. crashes.zip - Steps to reproduceThis is how it should be rendered (Salt 2017.7, reclass):
And this is what happens with Salt develop branch:
And while reducing my reclass tree to the minimal reproducible state, I found another crash:
|
@olivier-mauras Would you mind joining the Slack group? http://saltstackcommunity.herokuapp.com/ I'd like to discuss a few other issues I found, before filing them on Github. |
@max-arnold have you been able to use saltclass in your deployment, or are you still using reclass? |
@ketzacoatl Yes, I was able to use saltclass, but only for trivial purposes (new state tree from scratch with ~10 states and 2 nodes). Was bitten multiple times by silent failures on missing variable expansion. I was unable to migrate the production install mentioned above (~300 classes, ~80 nodes, ~90 states). The issues so far:
I still hope that eventually, we will have a robust and well maintained reclass implementation in the core and I'm willing to help with testing once the issues are resolved. In the meantime I patched the original issue with reclass madduck/reclass#83 and @epcim ported it salt-formulas/reclass#49 to the maintained reclass fork which I recommend to use for now: https://github.com/salt-formulas/reclass/ |
Another one (Fluorine): #50262 |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. If this issue is closed prematurely, please leave a comment and we will gladly reopen the issue. |
not stale |
Thank you for updating this issue. It is no longer marked as stale. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. If this issue is closed prematurely, please leave a comment and we will gladly reopen the issue. |
Bump |
Thank you for updating this issue. It is no longer marked as stale. |
Closing this issue due to age and lack of activity. Please test this on version 3006.2 and create a new issue if the problem persists. The new issue template has more information and will allow us to track and reproduce the issue more effectively. Thanks! |
Description of Issue/Question
I spent more than 2 days trying to migrate existing reclass tree to saltclass (introduced in #42349) and found multiple issues with saltclass variable expansion.
The reason is that checking for
str
is not enough, strings can also beunicode
with 2.7: https://github.com/saltstack/salt/blob/2018.3.1/salt/utils/saltclass.py#L137This feature definitely needs more unit tests. Jenkins builds for 2.7 can catch issues like this.
Salt 2017.7, reclass:
Salt 2018.3.1, saltclass
Minimal state tree (both for reclass and saltclass) to reproduce: example.zip
Variable parsing code tells me that things like one below won't work:
It worked just fine with reclass.
I spent hours trying to understand why Jinja rendering fails with
Jinja variable 'str object' has no attribute 'get'
. We use variable expansion for pillar subtrees and due to issue (2) it returned unexpanded variable asstr
instead ofdict
.It is essential to hard fail on missing variables (and classes). If necessary, I will create a separate issue for this.
Any typo in a variable or class name should lead to failure with an appropriate error message; otherwise, it will eventually lead to silent failures in production. Failing hard is also useful for simple automated linting/testing.
So far I'm not ready to put Saltclass to production. Instead I fixed
reclass
to make it work with Salt 2018.3: madduck/reclass#83Versions Report
salt --versions-report
Salt Version: Salt: 2018.3.1Dependency Versions:
cffi: Not Installed
cherrypy: Not Installed
dateutil: Not Installed
docker-py: Not Installed
gitdb: Not Installed
gitpython: Not Installed
ioflo: Not Installed
Jinja2: 2.8
libgit2: Not Installed
libnacl: Not Installed
M2Crypto: Not Installed
Mako: Not Installed
msgpack-pure: Not Installed
msgpack-python: 0.5.6
mysql-python: Not Installed
pycparser: Not Installed
pycrypto: 2.6.1
pycryptodome: Not Installed
pygit2: Not Installed
Python: 2.7.15 (default, May 2 2018, 00:53:27)
python-gnupg: Not Installed
PyYAML: 3.11
PyZMQ: 17.0.0
RAET: Not Installed
smmap: Not Installed
timelib: Not Installed
Tornado: 4.5.3
ZMQ: 4.1.6
System Versions:
dist:
locale: UTF-8
machine: x86_64
release: 17.6.0
system: Darwin
version: 10.13.5 x86_64
The text was updated successfully, but these errors were encountered: