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.
Since I added these modules in 2017.7.0, Capirca has been released on PyPI,
now available to be installed as a regular Python library.
Besides that, in the past there were various issues due to the way the modules
are interacting with the underlying library, solved by adding a hardcoded list
for the policy term fields. This has caused some issues in the past, and had
to be patches, e.g., db255d3702 or
1e74141cc0.
While the changes referenced above are not particularly big, it's tedious to
always keep an eye on Capirca and be aware of what's newly added or changed.
Besides, this may have caused issues for users in the past when using other
Capirca versions.
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>