Closed HontoNoRoger closed 6 years ago
@HontoNoRoger, thanks for the report.
Any update on this? I have just now run into this with 2016.3.1 pydsl seems to be broken for salt-ssh. Any input I can provide?
[CRITICAL] Rendering SLS check_mk.sites_p failed, render error: 'NoneType' object has no attribute 'building_highstate'
dev-sat:
- Rendering SLS check_mk.sites_p failed, render error: 'NoneType' object has no attribute 'building_highstate'
Traceback (most recent call last):
File "/usr/lib/python2.6/site-packages/salt/state.py", line 2776, in render_state
sls, rendered_sls=mods
File "/usr/lib/python2.6/site-packages/salt/template.py", line 95, in compile_template
ret = render(input_data, saltenv, sls, **render_kwargs)
File "/usr/lib/python2.6/site-packages/salt/renderers/pydsl.py", line 360, in render
dsl_sls = pydsl.Sls(sls, saltenv, rendered_sls)
File "/usr/lib/python2.6/site-packages/salt/utils/pydsl.py", line 120, in __init__
self.included_highstate = HighState.get_active().building_highstate
AttributeError: 'NoneType' object has no attribute 'building_highstate'
@bdabelow, thanks for the info. What systems are you running salt-ssh from and to, and do you have a minimum repeatable test case?
This is on: Oracle Linux 6.7 Linux 3.8.13-118.3.2.el6uek.x86_64 Python 2.6.6 Salt 2016.3.1
salt-ssh is used to the localhost in this testcase, but happens for remote machines as well.
debug/23454_01.sls:
#!pydsl
tmpdir = state("tmp-dir")
tmpdir.file.directory(name="/tmp/23454")
[root@dev-allinone salt]# salt dev-allinone state.apply debug.23454_01
dev-allinone:
----------
ID: tmp-dir
Function: file.directory
Name: /tmp/23454
Result: True
Comment: Directory /tmp/23454 updated
Started: 12:03:30.683639
Duration: 12.031 ms
Changes:
----------
/tmp/23454:
New Dir
----------
ID: _slsmod_debug.23454_01
Function: stateconf.set
Result: True
Comment:
Started: 12:03:30.696298
Duration: 0.454 ms
Changes:
Summary for dev-allinone
------------
Succeeded: 2 (changed=1)
Failed: 0
------------
Total states run: 2
[root@dev-allinone salt]# rm -rf /tmp/23454/
[root@dev-allinone salt]# salt-ssh dev-allinone state.apply debug.23454_01
[CRITICAL] Rendering SLS debug.23454_01 failed, render error: 'NoneType' object has no attribute 'building_highstate'
dev-allinone:
- Rendering SLS debug.23454_01 failed, render error: 'NoneType' object has no attribute 'building_highstate'
Traceback (most recent call last):
File "/usr/lib/python2.6/site-packages/salt/state.py", line 2776, in render_state
sls, rendered_sls=mods
File "/usr/lib/python2.6/site-packages/salt/template.py", line 95, in compile_template
ret = render(input_data, saltenv, sls, **render_kwargs)
File "/usr/lib/python2.6/site-packages/salt/renderers/pydsl.py", line 360, in render
dsl_sls = pydsl.Sls(sls, saltenv, rendered_sls)
File "/usr/lib/python2.6/site-packages/salt/utils/pydsl.py", line 120, in __init__
self.included_highstate = HighState.get_active().building_highstate
AttributeError: 'NoneType' object has no attribute 'building_highstate'
No update so far?
This issue is rendering salt-ssh
useless for more complex set-ups where PyDSL (or potentially other renderers) are needed.
I'm having an issue with
salt-ssh
while running a highstate on a minion. The problem here is a rendering error for a custom users SLS which doesn't occur in a normal salt run. The SLS file is written in PyDSL, so I cannot assure it's only a problem for PyDSL states.The test run is not the cause of the problem, the problem also occures without test mode activated.
Here's the used users SLS file (written in pydsl):