This is fix errors like the following when building docs:
WARNING: autodoc: failed to import module 'salt.states.saltmod'; the following exception was raised:
Traceback (most recent call last):
File "/public/src/salt/env/lib/python3.6/site-packages/sphinx/ext/autodoc/importer.py", line 140, in import_module
__import__(modname)
File "/public/src/salt/salt/states/saltmod.py", line 36, in <module>
import salt.output
File "/public/src/salt/salt/output/__init__.py", line 19, in <module>
import salt.loader
File "/public/src/salt/salt/loader.py", line 23, in <module>
import salt.config
File "/public/src/salt/salt/config/__init__.py", line 27, in <module>
import salt.utils.network
File "/public/src/salt/salt/utils/network.py", line 35, in <module>
import salt.utils.zeromq
File "/public/src/salt/salt/utils/zeromq.py", line 39, in <module>
if tornado.version_info < (5,):
TypeError: '<' not supported between instances of 'Mock' and 'tuple'
(cherry picked from commit 8199700fdb)
The auth validation functions were using flawed logic to validate the
expressions configured for a given eauth plugin. To "expand" the
expression, it would use `salt.utils.minions.parse_target()` to analyze
the expression. However, this function was intended to be used on
individual words in a compound expression, not on a compound expression
as a whole. This means that any multi-word compound expression would
fail to validate. By assuming that the euth expression is compound and
using `check_minions()` to get the list of minions that match the
expression, we ensure that it is properly validated.
If the `pyvmomi` library is missing, all tests from the
tests.unit.modules.RemoveCapacityFromDiskgroupTestCase will fail:
```
ERROR: test__get_proxy_target_call
(unit.modules.test_vsphere.RemoveCapacityFromDiskgroupTestCase)
[CPU:0.0%|MEM:35.1%]
----------------------------------------------------------------------
Traceback (most recent call last):
File "salt/utils/vmware.py", line 485, in disconnect
Disconnect(service_instance)
NameError: name 'Disconnect' is not defined
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "salt/modules/vsphere.py", line 381, in _gets_service_instance_via_proxy
salt.utils.vmware.disconnect(local_service_instance)
File "salt/utils/vmware.py", line 486, in disconnect
except vim.fault.NoPermission as exc:
NameError: name 'vim' is not defined
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "salt/utils/vmware.py", line 485, in disconnect
Disconnect(service_instance)
NameError: name 'Disconnect' is not defined
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "tests/unit/modules/test_vsphere.py", line 1568, in test__get_proxy_target_call
capacity_disk_ids=['fake_disk1', 'fake_disk2'])
File "salt/modules/vsphere.py", line 295, in __supports_proxies
return fn(*args, **salt.utils.args.clean_kwargs(**kwargs))
File "salt/modules/vsphere.py", line 386, in _gets_service_instance_via_proxy
salt.utils.vmware.disconnect(local_service_instance)
File "/home/bdrung/projects/salt/debian/salt/utils/vmware.py", line 486, in disconnect
except vim.fault.NoPermission as exc:
NameError: name 'vim' is not defined
```
Signed-off-by: Benjamin Drung <benjamin.drung@cloud.ionos.com>