I'm in the processing of trying to upgrade from salt 3000.5 to 3002.2 on a CentOS 7 machine. In testing the new version I discovered my custom state is broken due, I believe, to changes in the way imports are being handled.
I have the files:
/srv/salt/_satess/asdt/__init__.py
/srv/salt/_states/asdt/Pkg.py
In __init__.py I have "from _Pkg import parsePkg"
Prior to upgrading to 3002 this worked and my state did its thing. Since upgrading I now get:
[DEBUG ] Failed to import states asdt:
Traceback (most recent call last):
File "/usr/lib/python3.6/site-packages/salt/loader.py", line 1686, in _load_module
mod = spec.loader.load_module()
File "<frozen importlib._bootstrap_external>", line 399, in _check_name_wrapper
File "<frozen importlib._bootstrap_external>", line 823, in load_module
File "<frozen importlib._bootstrap_external>", line 682, in load_module
File "<frozen importlib._bootstrap>", line 265, in _load_module_shim
File "<frozen importlib._bootstrap>", line 684, in _load
File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 678, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "/var/cache/salt/minion/extmods/states/asdt/__init__.py", line 8, in <module>
from _Pkg import parsePkg
ModuleNotFoundError: No module named '_Pkg'
I've tried changing the import from _Pkg to asdt._Pkg but that didn't improve things. If anyone has any suggestions, or can point me towards documentation, on how to get imports working properly in custom states under salt 3002.2 I'd appreciate it.
Thanks