Closed markododa closed 6 years ago
It seems like the new path is @salt.utils.decorators.path.which
Changing salt.utils.decorators.which
and adding
import salt.utils.decorators.path
works just fine
@Jetman80 Thanks for fixing this in your branch, please make a PR.
@markododa please star this repo if you have it in use :)
The proposed solution will break on previous (<2018.3) salt versions. Need to do some intelligent/dirty stuff like:
try:
import salt.utils.decorators.path
except ImportError:
# Dirty monkey patch salt.utils.decorators to have
# the relocated 'salt.utils.decorators.which' decorator
# available as 'salt.utils.decorators.path.which'
import salt.utils.decorators
salt.utils.decorators.path = salt.utils.decorators
Since I'm on this anyway, I've created PR https://github.com/saltstack-formulas/lxd-formula/pull/15
@pcdummy check if this is not too dirty...
done by @keesbos
When i'm trying to run
salt-call --local lxd.version
i get[ERROR ] Failed to import module lxd, this is due most likely to a syntax error: Traceback (most recent call last): File "/usr/lib/python2.7/dist-packages/salt/loader.py", line 1459, in _load_module mod = imp.load_module(mod_namespace, fn_, fpath, desc) File "/var/cache/salt/minion/extmods/modules/lxd.py", line 114, in <module> @salt.utils.decorators.which('lxd') AttributeError: 'module' object has no attribute 'which' 'lxd' __virtual__ returned False: 'module' object has no attribute 'which'
Checking out the code i see that salt.utils.decorators doesn't have a function named which
` Python 2.7.13 (default, Nov 24 2017, 17:33:09) [GCC 6.3.0 20170516] on linux2 Type "help", "copyright", "credits" or "license" for more information.