Commit graph

107928 commits

Author SHA1 Message Date
Tyler Johnson
0f4cce0ae6 Don't fail if cleanup happens in the teardown 2020-05-01 06:42:09 -07:00
Tyler Johnson
4baa535b24 added back PREFIX 2020-05-01 06:42:09 -07:00
Tyler Johnson
a43bab7aea Fetch installer using new repo format 2020-05-01 06:42:09 -07:00
Cédric Bosdonnat
47f6194c64 Add virt.all_capabilities
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.
2020-05-01 06:40:28 -07:00
Mike Place
6636917438 Port #50954 to master 2020-05-01 06:34:18 -07:00
Mircea Ulinic
8810423818 Port #51032 to master 2020-05-01 06:32:05 -07:00
Nathan Fish
a0585b168b Port #51060 to master 2020-05-01 06:30:57 -07:00
Kavya Chandrashekhar
b8b4896a02 Port #51444 to master 2020-05-01 06:26:19 -07:00
Bryce Larson
00c3c149ec add fedora-32 2020-04-30 16:13:06 -07:00
Bryce Larson
d4a07bfc15 drop fedora-30 2020-04-30 12:30:11 -07:00
Joe Eacott
f9ac093cdd Address grain issue and add test 2020-04-30 11:28:10 -07:00
Dmitry Kuzmenko
e5057287a7 Correct path to test_doc in filename_map.yml 2020-04-30 10:09:55 -07:00
Dmitry Kuzmenko
f9646c8e9d Remove salt/utils/vt.py duplication from filename map. 2020-04-30 10:09:55 -07:00
Radostin Stoyanov
0c2c72cb7a test: Add test for virt.cpu_baseline()
Signed-off-by: Radostin Stoyanov <rstoyanov@fedoraproject.org>
2020-04-29 16:34:26 -07:00
Radostin Stoyanov
9daaaadc85 virt: Convert cpu_baseline ElementTree to string
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>
2020-04-29 16:34:26 -07:00
Dmitry Kuzmenko
b8f82fadcf Test fix 2020-04-29 16:31:50 -07:00
Dmitry Kuzmenko
f24669d608 Port #52709 to master
LocalClient: don't parse input twice and test fix.

Related to #49886 where passing input args and kwargs through
parse_input was inroduced.
2020-04-29 16:31:50 -07:00
Matt Phillips
b966cda82d Port #49886 to master
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.
2020-04-29 16:31:50 -07:00
Pedro Algarvio
2352457b35 Man pages test does not need to be an integration test 2020-04-29 16:28:47 -07:00
Bryce Larson
ce2ab6282d add ubuntu 2004 2020-04-29 16:27:59 -07:00
Kirill Goncharov
671eb1e552
Fix salt-ssh pillar bug for state.sls_id function (#53348)
* 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>
2020-04-29 15:26:31 -07:00
J. Eduardo
ff4fd1eb3a
Allow custom validity dates over new X509 certificates (#53149)
* 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.
2020-04-29 15:26:03 -07:00
Gareth J. Greenaway
7c37be44eb
[master] Porting #49837 to master (#54552)
* Porting PR #49837 to 2019.2.1

* Fixing versionchanged

Fixing versionchanged

* Fixing black issues and docstring issues.

* Another doc fix.

Co-authored-by: Daniel Wozniak <dwozniak@saltstack.com>
2020-04-29 15:25:09 -07:00
Benjamin Drung
ce45306f7f highstate_doc: Fix spelling mistake of process
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>
2020-04-29 15:16:06 -07:00
Proskurin Kirill
60f1303471
Additional fixes for using cron state with non-root Minion (#56973)
* Fixed cron state to make it work with non-root minions

* Added changelogs

Co-authored-by: Daniel Wozniak <dwozniak@saltstack.com>
2020-04-29 15:14:47 -07:00
Benjamin Drung
43bd67609b Fix literal comparison
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>
2020-04-29 15:13:07 -07:00
Benjamin Drung
2054faec86 Fix deprecation warnings for imports from collections
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>
2020-04-29 15:12:17 -07:00
Benjamin Drung
1b0b40e30c Fix spelling mistake of multiprocessing
Signed-off-by: Benjamin Drung <benjamin.drung@cloud.ionos.com>
2020-04-29 15:11:42 -07:00
Benjamin Drung
fa3eda57b1 Fix spelling mistake of there's
Signed-off-by: Benjamin Drung <benjamin.drung@cloud.ionos.com>
2020-04-29 15:11:42 -07:00
Benjamin Drung
7df783153e Fix spelling mistake of something
Signed-off-by: Benjamin Drung <benjamin.drung@cloud.ionos.com>
2020-04-29 15:11:42 -07:00
Benjamin Drung
5ef39a55a3 Fix spelling mistake of specified
Signed-off-by: Benjamin Drung <benjamin.drung@cloud.ionos.com>
2020-04-29 15:11:42 -07:00
Benjamin Drung
5f37f65df5 Fix spelling mistake of removable
Signed-off-by: Benjamin Drung <benjamin.drung@cloud.ionos.com>
2020-04-29 15:11:42 -07:00
Benjamin Drung
ca5ea34d0f Fix spelling mistake of performance
Signed-off-by: Benjamin Drung <benjamin.drung@cloud.ionos.com>
2020-04-29 15:11:42 -07:00
Benjamin Drung
249955e216 Fix spelling mistake of overridden
Signed-off-by: Benjamin Drung <benjamin.drung@cloud.ionos.com>
2020-04-29 15:11:42 -07:00
Benjamin Drung
6820518982 Fix spelling mistake of occurrences
Signed-off-by: Benjamin Drung <benjamin.drung@cloud.ionos.com>
2020-04-29 15:11:42 -07:00
Benjamin Drung
77e5f894ce Fix spelling mistake of conversions
Signed-off-by: Benjamin Drung <benjamin.drung@cloud.ionos.com>
2020-04-29 15:11:42 -07:00
Benjamin Drung
e6699dd96f Fix spelling mistake of consistency
Signed-off-by: Benjamin Drung <benjamin.drung@cloud.ionos.com>
2020-04-29 15:11:42 -07:00
Benjamin Drung
066aea0114 Fix spelling mistake of beginning
Signed-off-by: Benjamin Drung <benjamin.drung@cloud.ionos.com>
2020-04-29 15:11:42 -07:00
Benjamin Drung
8c27fc8baf Fix spelling mistake of authentication
Signed-off-by: Benjamin Drung <benjamin.drung@cloud.ionos.com>
2020-04-29 15:11:42 -07:00
Benjamin Drung
0cd04786b1 Fix spelling mistake of above
Signed-off-by: Benjamin Drung <benjamin.drung@cloud.ionos.com>
2020-04-29 15:11:42 -07:00
Benjamin Drung
ec95f729af Fix spelling mistake of retrieves
Signed-off-by: Benjamin Drung <benjamin.drung@cloud.ionos.com>
2020-04-29 15:11:42 -07:00
Benjamin Drung
6cc924cd33 Fix spelling mistake of initializes
Signed-off-by: Benjamin Drung <benjamin.drung@cloud.ionos.com>
2020-04-29 15:11:42 -07:00
Benjamin Drung
2f0f9ab2ec Fix spelling mistake of destroy
Signed-off-by: Benjamin Drung <benjamin.drung@cloud.ionos.com>
2020-04-29 15:11:42 -07:00
Benjamin Drung
c1170c801c Fix spelling mistake of contributors
Signed-off-by: Benjamin Drung <benjamin.drung@cloud.ionos.com>
2020-04-29 15:11:42 -07:00
sizgiyaev
9210fc7e3c Port #51521 to master 2020-04-29 15:11:13 -07:00
Benjamin Drung
69ac5a36f9 Fix condition for ConfigTestCase.test_datetime_config_validation
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>
2020-04-29 15:10:24 -07:00
Kert
04ca47065e Port #51572 to master 2020-04-29 15:09:56 -07:00
Benjamin Drung
53cfbc4139 Fix shell in CMDMODTestCase.test_run_chroot_runas
cmdmod.run_chroot uses `DEFAULT_SHELL` which might vary on different
systems and causes `CMDMODTestCase.test_run_chroot_runas` to fail:

```
======================================================================
FAIL: test_run_chroot_runas (unit.modules.test_cmdmod.CMDMODTestCase)
[CPU:0.0%|MEM:26.0%] Test run_chroot when a runas parameter is provided
----------------------------------------------------------------------
Traceback (most recent call last):
  File "tests/unit/modules/test_cmdmod.py", line 634, in test_run_chroot_runas
    run_all_mock.assert_called_with(
  File "/usr/lib/python3.8/unittest/mock.py", line 913, in assert_called_with
    raise AssertionError(_error_message()) from cause
AssertionError: expected call not found.
Expected: run_all('chroot --userspec foobar: /mnt /bin/sh -c ls', bg=False, clean_env=False, cwd=None, env=None, ignore_retcode=False, log_callback=None, output_encoding=None, output_loglevel='quiet', pillar=None, pillarenv=None, python_shell=True, reset_system_locale=True, rstrip=True, saltenv='base', shell='/bin/bash', stdin=None, success_retcodes=None, template=None, timeout=None, umask=None, use_vt=False)
Actual: run_all('chroot --userspec foobar: /mnt /bin/sh -c ls', cwd=None, stdin=None, shell='/bin/sh', python_shell=True, env=None, clean_env=False, template=None, rstrip=True, umask=None, output_encoding=None, output_loglevel='quiet', log_callback=None, timeout=None, reset_system_locale=True, ignore_retcode=False, saltenv='base', pillarenv=None, pillar=None, use_vt=False, success_retcodes=None, bg=False)

----------------------------------------------------------------------
```

This can be easily reproduced by running:

```
env -i python3 ./tests/runtests.py -v --no-report -n unit.modules.test_cmdmod.CMDMODTestCase.test_run_chroot_runas
```

Fix the test case by specifying a shell when calling `cmdmod.run_chroot`.

Signed-off-by: Benjamin Drung <benjamin.drung@cloud.ionos.com>
2020-04-29 15:08:07 -07:00
Benjamin Drung
951543ee31 Skip TOMLRendererTestCase if toml is missing
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>
2020-04-29 15:06:42 -07:00
Proskurin Kirill
e1d4f9adfb Changelog update 2020-04-29 15:02:09 -07:00