You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[ERROR ] An un-handled exception was caught by Salt's global exception handler:
AttributeError: 'NoneType' object has no attribute 'saltenv'
Traceback (most recent call last):
File "/usr/local/bin/salt-call", line 10, in <module>
sys.exit(salt_call())
File "/usr/local/lib/python3.7/dist-packages/salt/scripts.py", line 443, in salt_call
client.run()
File "/usr/local/lib/python3.7/dist-packages/salt/cli/call.py", line 50, in run
caller.run()
File "/usr/local/lib/python3.7/dist-packages/salt/cli/caller.py", line 95, in run
ret = self.call()
File "/usr/local/lib/python3.7/dist-packages/salt/cli/caller.py", line 203, in call
self.opts, data, func, args, kwargs
File "/usr/local/lib/python3.7/dist-packages/salt/loader/lazy.py", line 149, in __call__
return self.loader.run(run_func, *args, **kwargs)
File "/usr/local/lib/python3.7/dist-packages/salt/loader/lazy.py", line 1228, in run
return self._last_context.run(self._run_as, _func_or_method, *args, **kwargs)
File "/usr/local/lib/python3.7/dist-packages/salt/loader/lazy.py", line 1243, in _run_as
return _func_or_method(*args, **kwargs)
File "/usr/local/lib/python3.7/dist-packages/salt/executors/direct_call.py", line 10, in execute
return func(*args, **kwargs)
File "/usr/local/lib/python3.7/dist-packages/salt/loader/lazy.py", line 149, in __call__
return self.loader.run(run_func, *args, **kwargs)
File "/usr/local/lib/python3.7/dist-packages/salt/loader/lazy.py", line 1228, in run
return self._last_context.run(self._run_as, _func_or_method, *args, **kwargs)
File "/usr/local/lib/python3.7/dist-packages/salt/loader/lazy.py", line 1243, in _run_as
return _func_or_method(*args, **kwargs)
File "/usr/local/lib/python3.7/dist-packages/salt/modules/saltcheck.py", line 471, in run_state_tests
stl.load_test_suite()
File "/usr/local/lib/python3.7/dist-packages/salt/modules/saltcheck.py", line 1170, in load_test_suite
self._load_file_salt_rendered(myfile)
File "/usr/local/lib/python3.7/dist-packages/salt/modules/saltcheck.py", line 1178, in _load_file_salt_rendered
tests = _render_file(filepath, self.saltenv)
File "/usr/local/lib/python3.7/dist-packages/salt/modules/saltcheck.py", line 623, in _render_file
rendered = __salt__["slsutil.renderer"](file_path, saltenv=global_scheck.saltenv)
AttributeError: 'NoneType' object has no attribute 'saltenv'
Traceback (most recent call last):
File "/usr/local/bin/salt-call", line 10, in <module>
sys.exit(salt_call())
File "/usr/local/lib/python3.7/dist-packages/salt/scripts.py", line 443, in salt_call
client.run()
File "/usr/local/lib/python3.7/dist-packages/salt/cli/call.py", line 50, in run
caller.run()
File "/usr/local/lib/python3.7/dist-packages/salt/cli/caller.py", line 95, in run
ret = self.call()
File "/usr/local/lib/python3.7/dist-packages/salt/cli/caller.py", line 203, in call
self.opts, data, func, args, kwargs
File "/usr/local/lib/python3.7/dist-packages/salt/loader/lazy.py", line 149, in __call__
return self.loader.run(run_func, *args, **kwargs)
File "/usr/local/lib/python3.7/dist-packages/salt/loader/lazy.py", line 1228, in run
return self._last_context.run(self._run_as, _func_or_method, *args, **kwargs)
File "/usr/local/lib/python3.7/dist-packages/salt/loader/lazy.py", line 1243, in _run_as
return _func_or_method(*args, **kwargs)
File "/usr/local/lib/python3.7/dist-packages/salt/executors/direct_call.py", line 10, in execute
return func(*args, **kwargs)
File "/usr/local/lib/python3.7/dist-packages/salt/loader/lazy.py", line 149, in __call__
return self.loader.run(run_func, *args, **kwargs)
File "/usr/local/lib/python3.7/dist-packages/salt/loader/lazy.py", line 1228, in run
return self._last_context.run(self._run_as, _func_or_method, *args, **kwargs)
File "/usr/local/lib/python3.7/dist-packages/salt/loader/lazy.py", line 1243, in _run_as
return _func_or_method(*args, **kwargs)
File "/usr/local/lib/python3.7/dist-packages/salt/modules/saltcheck.py", line 471, in run_state_tests
stl.load_test_suite()
File "/usr/local/lib/python3.7/dist-packages/salt/modules/saltcheck.py", line 1170, in load_test_suite
self._load_file_salt_rendered(myfile)
File "/usr/local/lib/python3.7/dist-packages/salt/modules/saltcheck.py", line 1178, in _load_file_salt_rendered
tests = _render_file(filepath, self.saltenv)
File "/usr/local/lib/python3.7/dist-packages/salt/modules/saltcheck.py", line 623, in _render_file
rendered = __salt__["slsutil.renderer"](file_path, saltenv=global_scheck.saltenv)
AttributeError: 'NoneType' object has no attribute 'saltenv'
The global_scheck global variable is intact before the following lines of code, but set to None after it runs.
Converting the Pyobjects code to "normal" YAML causes the problem to cease.
/tmp/pyobj:
file.touch
The Saltcheck code should work properly with any renderer.
Versions Report
salt --versions-report
(Provided by running salt --versions-report. Please also mention any differences in master/minion versions.)
Salt Version:
Salt: 3005+0na.d5dec79Dependency Versions:
cffi: Not Installedcherrypy: Not Installeddateutil: Not Installeddocker-py: Not Installedgitdb: Not Installedgitpython: Not InstalledJinja2: 3.1.2libgit2: Not InstalledM2Crypto: Not InstalledMako: Not Installedmsgpack: 1.0.4msgpack-pure: Not Installedmysql-python: Not Installedpycparser: Not Installedpycrypto: 2.6.1pycryptodome: 3.15.0pygit2: Not InstalledPython: 3.7.3 (default, Jan 22 2021, 20:04:44)python-gnupg: Not InstalledPyYAML: 6.0PyZMQ: 23.2.1smmap: Not Installedtimelib: Not InstalledTornado: 4.5.3ZMQ: 4.3.4System Versions:
dist: debian 10 busterlocale: UTF-8machine: x86_64release: 4.19.0-21-amd64system: Linuxversion: Debian GNU/Linux 10 buster
Additional context
Also verified as an issue in version 3004.2
The text was updated successfully, but these errors were encountered:
Description
The Saltcheck module doesn't work with the Pyobjects Renderer.
Setup
Create a directory structure with empty files as shown below:
Enter this information into the
init.sls
file:Enter this information into the
init.tst
file:Steps to Reproduce the behavior
Running the state tests as shown in this command:
Fails with this error:
The
global_scheck
global variable is intact before the following lines of code, but set toNone
after it runs.salt/salt/modules/saltcheck.py
Lines 1309 to 1311 in 1f78f9b
I suspect that the Pyobjects Renderer is obliterating the Saltcheck module globals when it invokes the Loader inside of
load_states
.salt/salt/renderers/pyobjects.py
Line 362 in 1f78f9b
Expected behavior
Converting the Pyobjects code to "normal" YAML causes the problem to cease.
The Saltcheck code should work properly with any renderer.
Versions Report
salt --versions-report
(Provided by running salt --versions-report. Please also mention any differences in master/minion versions.)Additional context
Also verified as an issue in version 3004.2
The text was updated successfully, but these errors were encountered: