In order to get all possible capabilities from a host, the user has to
call virt.capabilities, and then loop over the guests and domains
before calling virt.domain_capabilities for each of them.
This commit embeds all this logic to get them all in a single
virt.all_capabilities call.
In commit 0f5184c (Remove minidom use in virt module) the value
of `cpu` become `xml.etree.ElementTree.Element` and no longer
has a method `toxml()`. This results in the following error:
$ salt '*' virt.cpu_baseline
host2:
The minion function caused an exception: Traceback (most recent call last):
File "/usr/lib/python3.7/site-packages/salt/minion.py", line 1675, in _thread_return
return_data = minion_instance.executors[fname](opts, data, func, args, kwargs)
File "/usr/lib/python3.7/site-packages/salt/executors/direct_call.py", line 12, in execute
return func(*args, **kwargs)
File "/usr/lib/python3.7/site-packages/salt/modules/virt.py", line 4410, in cpu_baseline
return cpu.toxml()
AttributeError: 'xml.etree.ElementTree.Element' object has no attribute 'toxml'
Signed-off-by: Radostin Stoyanov <rstoyanov@fedoraproject.org>
localclient: pass input args/kwargs through salt.utils.args.parse_input
this functionality brings localclient in line with what happens on the
cli, as well as what runnerclient does. this ensures that any foo=bar
kwargs passed in as args are handled accordingly. right now localclient
relies on SaltCMDOptionParser to do this handling for us, but that
leaves a hole when salt-api interactions are brought in.
* Fix salt-ssh pillar bug for state.sls_id function
* Add salt-ssh test for state.sls_id function with pillar data
* Improve cleaning after tests in SSHStateTest
* Use more specific temp file name to prevent collisions
* Blacken changed files
* Lint fix
* Isort
Co-authored-by: Daniel A. Wozniak <dwozniak@saltstack.com>
* Ported unit test for fix to new Salt master branch.
* Ported fixes to allow not_before and not_after to master branch.
* Removed CSR tests as they are not available in master.
* Fixed test to ensure a string is passed to the write method.
* Lint fixes.
* Changed salt version.
* Removed unused variable detected by lint
* Code formatting changes.
* Added integration tests for x509 state covering new functionality.
* Removed deprecated options from documentation.
The word `process` and variants of it is mispelled. Fix the spelling
mistakes which includes changing the configuration option from
`proccesser` to `processor` in `highstate_doc`.
Signed-off-by: Benjamin Drung <benjamin.drung@cloud.ionos.com>
When building the documentation, sphinx prints following error message:
```
salt/states/user.py:161: SyntaxWarning: "is not" with a literal. Did you mean "!="?
and expire is not -1
```
Fix the literal comparison.
Signed-off-by: Benjamin Drung <benjamin.drung@cloud.ionos.com>
DeprecationWarning: Using or importing the ABCs from `collections`
instead of from `collections.abc` is deprecated since Python 3.3, and in
3.9 it will stop working.
Therefore try to import the abstract base classes from `collections.abc`
before falling back to `collections`.
In commit 420bbe8c08 the import order was
missed for some files.
Signed-off-by: Benjamin Drung <benjamin.drung@cloud.ionos.com>
The `jsonschema` library only uses `strict_rfc3339` and not `isodate`.
The test case `ConfigTestCase.test_datetime_config_validation` will fail
if `isodate` is available but not `strict_rfc3339`:
```
======================================================================
FAIL: test_datetime_config_validation (unit.utils.test_schema.ConfigTestCase)
[CPU:0.0%|MEM:26.0%]
----------------------------------------------------------------------
Traceback (most recent call last):
File "tests/unit/utils/test_schema.py", line 897, in test_datetime_config_validation
jsonschema.validate(
AssertionError: ValidationError not raised
----------------------------------------------------------------------
```
Therefore require `strict_rfc3339` to be present for running
`ConfigTestCase.test_datetime_config_validation`.
fixes#55936
Signed-off-by: Benjamin Drung <benjamin.drung@cloud.ionos.com>
If the toml library is missing, `TOMLRendererTestCase` will fail:
```
======================================================================
ERROR: test_toml_render_string (unit.renderers.test_toml.TOMLRendererTestCase)
[CPU:0.0%|MEM:26.0%]
----------------------------------------------------------------------
Traceback (most recent call last):
File "salt/serializers/toml.py", line 46, in deserialize
return toml.loads(stream_or_string)
NameError: name 'toml' is not defined
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "tests/unit/renderers/test_toml.py", line 38, in test_toml_render_string
result = toml.render(data)
File "salt/renderers/toml.py", line 23, in render
data = deserialize(sls_data) or {}
File "salt/serializers/toml.py", line 48, in deserialize
raise DeserializationError(error)
salt.serializers.DeserializationError: name 'toml' is not defined
```
Signed-off-by: Benjamin Drung <benjamin.drung@cloud.ionos.com>