Description
__virtual__ method now checks the zfs_support grain unsafely, leading to errors on platforms without this grain, like Windows.2020-06-26 05:55:59,669 [salt.loader :2000][ERROR ][3960] Exception raised when processing __virtual__ function for salt.loaded.int.states.zpool. Module will not be loaded: 'zfs_support'
Traceback (most recent call last):
File "C:\salt\bin\lib\site-packages\salt-3001-py3.7.egg\salt\loader.py", line 1983, in _process_virtual
virtual = getattr(mod, virtual_func)()
File "C:\salt\bin\lib\site-packages\salt-3001-py3.7.egg\salt\states\zpool.py", line 92, in __virtual__
if __grains__["zfs_support"]:
File "C:\salt\bin\lib\site-packages\salt-3001-py3.7.egg\salt\utils\context.py", line 227, in __getitem__
return self._dict()[key]
KeyError: 'zfs_support'
2020-06-26 05:55:59,669 [salt.loader :2018][WARNING ][3960] salt.loaded.int.states.zpool.__virtual__() is wrongly returning `None`. It should either return `True`, `False` or a new name. If you're the developer of the module 'zpool', please fix this.
Setup
Run a Windows 3001 minion.
Steps to Reproduce the behavior
Run a Windows 3001 minion.
Expected behavior
No errors from this state.
Versions Report
salt --versions-report
(Provided by running salt --versions-report. Please also mention any differences in master/minion versions.)
Salt Version:
Salt: 3001
Dependency Versions:
cffi: 1.12.2
cherrypy: 17.4.1
dateutil: 2.8.0
docker-py: Not Installed
gitdb: 2.0.5
gitpython: Not Installed
Jinja2: 2.10.1
libgit2: Not Installed
M2Crypto: Not Installed
Mako: 1.0.7
msgpack-pure: Not Installed
msgpack-python: 0.5.6
mysql-python: Not Installed
pycparser: 2.19
pycrypto: Not Installed
pycryptodome: 3.9.7
pygit2: Not Installed
Python: 3.7.4 (tags/v3.7.4:e09359112e, Jul 8 2019, 19:29:22) [MSC v.1916 32 bit (Intel)]
python-gnupg: 0.4.4
PyYAML: 5.1.2
PyZMQ: 18.0.1
smmap: 2.0.5
timelib: 0.2.4
Tornado: 4.5.3
ZMQ: 4.3.1
System Versions:
dist:
locale: cp1252
machine: AMD64
release: 2012ServerR2
system: Windows
version: 2012ServerR2 6.3.9600 SP0
The funny thing is that PR was already ported to master by #55386.
@oeuftete PR is here.
Most helpful comment
@oeuftete PR is here.