Commit graph

114039 commits

Author SHA1 Message Date
Pedro Algarvio
4d49013247 Update to isort 5.10.1
Signed-off-by: Pedro Algarvio <palgarvio@vmware.com>
2022-08-01 12:49:16 -06:00
Pedro Algarvio
2ff4835ff3 Removed `runtests targets from noxfile.py`
Fixes #62239

Signed-off-by: Pedro Algarvio <palgarvio@vmware.com>
2022-07-29 09:33:35 -07:00
M S
95d7b09fa2 added newline for dig.PTR docs
Added the newline needed for salt documentation generation
2022-07-28 10:46:48 -06:00
M S
1c0a2ba05a Update changelog/62275.added
Co-authored-by: Megan Wilhite <mwilhite@vmware.com>
2022-07-28 10:46:48 -06:00
Matthew Saum
e0230e355e changed function from dig.X to dig.PTR 2022-07-28 10:46:48 -06:00
M S
59802f83fb Added correct versionadded
Updated versionadded frmo 9999.9 to 3006.0

Co-authored-by: Nicholas Hughes <nicholasmhughes@gmail.com>
2022-07-28 10:46:48 -06:00
Matthew Saum
55a425a542 Added a changelog file and a versionadded :: 9999.9 line to function 2022-07-28 10:46:48 -06:00
Matthew Saum
81974ab7ec dig.X functionality added for PTR lookups by IP, with unit test 2022-07-28 10:46:48 -06:00
Pedro Algarvio
44cbe7ea7f Switch to the github repository container and our own container mirrors
Signed-off-by: Pedro Algarvio <palgarvio@vmware.com>
2022-07-28 11:07:12 +01:00
Adam McKay
97547f892a Add changelog for #61727 2022-07-25 13:49:20 -06:00
Adam McKay
acc84b525a Raise exception when SoftLayer domain not configured
An exception was initialised but not actually raised when a domain was
not specified in the SoftLayer configuration
2022-07-25 13:49:20 -06:00
Megan Wilhite
82119c2a69 Update the salt pip executable to salt-pip 2022-07-25 13:11:23 -06:00
Pedro Algarvio
c6e6f77343 Switch to the SaltStack ORG on quay.io
Signed-off-by: Pedro Algarvio <palgarvio@vmware.com>
2022-07-23 10:21:54 +01:00
MKLeb
4c9f345a95 Allow changing the minion count with an environment variable 2022-07-22 10:26:59 -06:00
MKLeb
19e49400f0 remove f string for debian 9 2022-07-22 10:26:59 -06:00
MKLeb
037b4c2f0d remove test pki fixture and delete old 2022-07-22 10:26:59 -06:00
MKLeb
68d4f52cf7 add minion swarm test using saltfactories 2022-07-22 10:26:59 -06:00
Alyssa Rock
0555d65725 Revise topic per Murphy's review 2022-07-22 06:57:45 -06:00
Alyssa Rock
1956bca055 Add RHEL GPG key info 2022-07-22 06:57:45 -06:00
Pedro Algarvio
a1f1b6d555 Bump pygit2 requirement
Signed-off-by: Pedro Algarvio <palgarvio@vmware.com>
2022-07-22 07:24:35 +01:00
Pedro Algarvio
13a3db27f9 Python warnings, namely the setuptools one is not important for what's being tested
```
AssertionError: '/private/tmp/kitchen/testing/.nox/pytest-[4315 chars]…………' != '.…………………………………………………………………………………………………………[4052 chars]…………'
- /private/tmp/kitchen/testing/.nox/pytest-parametrized-3-crypto-none-transport-zeromq-coverage-true/lib/python3.9/site-packages/_distutils_hack/__init__.py:30: UserWarning: Setuptools is replacing distutils.
-   warnings.warn("Setuptools is replacing distutils.")
```

Signed-off-by: Pedro Algarvio <palgarvio@vmware.com>
2022-07-22 07:24:35 +01:00
Pedro Algarvio
ab9def79b6 Windows seems to struggle with this check when collecting tests.
```
tests\unit\modules\inspectlib\test_collector.py:27: in <module>
    @skipIf(no_symlinks(), "Git missing 'core.symlinks=true' config")
        Inspector  = <class 'salt.modules.inspectlib.collector.Inspector'>
        MagicMock  = <class 'mock.mock.MagicMock'>
        TestCase   = <class 'tests.support.unit.TestCase'>
        __builtins__ = <builtins>
        __cached__ = 'C:\\Users\\Administrator\\AppData\\Local\\Temp\\kitchen\\testing\\tests\\unit\\modules\\inspectlib\\__pycache__\\test_collector.cpython-38.pyc'
        __doc__    = '\n    :codeauthor: Bo Maryniuk <bo@suse.de>\n'
        __file__   = 'C:\\Users\\Administrator\\AppData\\Local\\Temp\\kitchen\\testing\\tests\\unit\\modules\\inspectlib\\test_collector.py'
        __loader__ = <_pytest.assertion.rewrite.AssertionRewritingHook object at 0x0000022B0C3A6B20>
        __name__   = 'tests.unit.modules.inspectlib.test_collector'
        __package__ = 'tests.unit.modules.inspectlib'
        __spec__   = ModuleSpec(name='tests.unit.modules.inspectlib.test_collector', loader=<_pytest.assertion.rewrite.AssertionRewritingHo...C:\\Users\\Administrator\\AppData\\Local\\Temp\\kitchen\\testing\\tests\\unit\\modules\\inspectlib\\test_collector.py')
        no_symlinks = <function no_symlinks at 0x0000022B0D05CC10>
        os         = <module 'os' from 'c:\\python38\\lib\\os.py'>
        patch      = <function patch at 0x0000022B2836FB80>
        skipIf     = <function skipIf at 0x0000022B270738B0>
tests\support\helpers.py:82: in no_symlinks
    output = subprocess.Popen(
        output     = ''
c:\python38\lib\subprocess.py:858: in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
        args       = ['git', 'config', '--get', 'core.symlinks']
        bufsize    = -1
        c2pread    = 5
        c2pwrite   = Handle(2176)
        close_fds  = True
        creationflags = 0
        cwd        = 'C:\\Users\\Administrator\\AppData\\Local\\Temp\\salt-tests-tmpdir'
        encoding   = None
        env        = None
        errors     = None
        errread    = -1
        errwrite   = Handle(2196)
        executable = None
        f          = <_io.BufferedReader name=5>
        p2cread    = Handle(1984)
        p2cwrite   = -1
        pass_fds   = ()
        preexec_fn = None
        restore_signals = True
        self       = <subprocess.Popen object at 0x0000022B3012E400>
        shell      = False
        start_new_session = False
        startupinfo = None
        stderr     = None
        stdin      = None
        stdout     = -1
        text       = None
        universal_newlines = None
c:\python38\lib\subprocess.py:1311: in _execute_child
    hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
E   NotADirectoryError: [WinError 267] The directory name is invalid
        args       = 'git config --get core.symlinks'
        attribute_list = {'handle_list': [1984, 2196, 2176]}
        c2pread    = 5
        c2pwrite   = Handle(2176)
        close_fds  = False
        creationflags = 0
        cwd        = 'C:\\Users\\Administrator\\AppData\\Local\\Temp\\salt-tests-tmpdir'
        env        = None
        errread    = -1
        errwrite   = Handle(2196)
        executable = None
        handle_list = [1984, 2196, 2176]
        have_handle_list = False
        p2cread    = Handle(1984)
        p2cwrite   = -1
        pass_fds   = ()
        preexec_fn = None
        self       = <subprocess.Popen object at 0x0000022B3012E400>
        shell      = False
        startupinfo = <subprocess.STARTUPINFO object at 0x0000022B2F5E54C0>
        unused_restore_signals = True
        unused_start_new_session = False
        use_std_handles = True
```

Signed-off-by: Pedro Algarvio <palgarvio@vmware.com>
2022-07-22 07:24:35 +01:00
Alyssa Rock
f87d581dde Add clarification per Shane's review 2022-07-21 06:53:31 -06:00
Alyssa Rock
2bccda6d91 Update release candidate documentation 2022-07-21 06:53:31 -06:00
Megan Wilhite
e4ba871678
Merge pull request #62350 from MKLeb/hotfix/update-master-with-merge
update master with 3005rc1 tag via merge
2022-07-20 13:47:52 -06:00
nicholasmhughes
58e3546613 fixes saltstack/salt#62336 no access to opts and sls vars in pyobjects renderer 2022-07-20 13:13:39 -06:00
MKLeb
40f71d77e3 Merge tag 'v3005rc1' into hotfix/update-master-with-merge
Version 3005rc1
2022-07-20 15:08:47 -04:00
Caleb Beard
6ddad5a10c Revert "Update changelog/versionadded for 3005 and add note for raspberry pi packages"
This reverts commit 6f444ab929.
2022-07-20 13:02:19 -06:00
Megan Wilhite
6f444ab929 Update changelog/versionadded for 3005 and add note for raspberry pi packages 2022-07-20 10:27:31 -06:00
Jerry Jones gajone3
deeb216952 fix documentation index ordering 2022-07-19 13:51:24 -06:00
Alan Somers
c6ddf5d1f1 Move logic from states/cron into modules/cron
This allows the cron.set_job and cron.set_special commands to change
cron entries from special to non-special or vise-versa.  It also removes
all changes to states/cron from this PR's original commit, while
retaining the behavioral changes to the cron.present state
2022-07-19 13:23:29 -06:00
Alan Somers
ba3f0e72ce Fix the assertions in test_set_job
The original assertion used "mock_method.call_args.assert_called_with",
which does nothing at all.  Correct usage is either
"mock_method.call_args == ..." or "mock_method.assert_called_with(...)"
2022-07-19 13:23:29 -06:00
Alan Somers
c89a0c19f0 Allow cron.present to change a timespec from non-special to special
Previously when changing a cron.present job from using a normal time
specification to special or vice-versa, it would duplicate the entry in
the crontab.
2022-07-19 13:23:29 -06:00
Sergey Kacheev
d22291d7e9 add deprecation warnings in salt/utils/zeromq.py:ip_bracket 2022-07-19 13:14:33 -06:00
Sergey Kacheev
1163ef6bb2 run isort --profile black 2022-07-19 13:14:33 -06:00
Sergey Kacheev
97f2fe4837 add changelog/62009.added 2022-07-19 13:14:33 -06:00
Sergey Kacheev
cf6e8c7a0f add tcp transport support for ipv6-only hosts 2022-07-19 13:14:33 -06:00
MKLeb
3dbbdc8393 Move the asserts to happen sooner and make sure the processes are getting killed properly 2022-07-19 12:59:31 -06:00
MKLeb
68b9aaa2cc add salt as daemons tests 2022-07-19 12:59:31 -06:00
krionbsd
2914fa3d1f Remove Debian 9: EoL 2022-07-19 06:35:00 -06:00
Pedro Algarvio
33c9b12fa8 Add `pytest-custom-exit-code==0.3.0` as a dependency.
When running the test suite it chunks, specially when running against
the changed files, some of the test groups might not collect any test
and Jenkins does not help with getting the exit code from scripts.
This is where ``pytest-custom-exit-code` comes in, it allows exiting
with a 0 exit code when no tests are collected.

Signed-off-by: Pedro Algarvio <palgarvio@vmware.com>
2022-07-18 14:56:16 -07:00
Pedro Algarvio
7d327a636f There are some commands which should always run, even if --install-only is passed to nox
Signed-off-by: Pedro Algarvio <palgarvio@vmware.com>
2022-07-18 14:56:16 -07:00
nicholasmhughes
559eadbfea remove rogue copy/paste line 2022-07-14 11:13:51 -06:00
nicholasmhughes
b30bd758f4 macos is consistently over duration right now. giving it more time 2022-07-14 11:13:51 -06:00
nicholasmhughes
66a8bf8919 fixes saltstack/salt#59585 postgres_privileges.present not idempotent for functions 2022-07-14 11:13:51 -06:00
Megan Wilhite
50e6892e2a Update changelog/versionadded for 3005 and add note for raspberry pi packages 2022-07-14 10:59:24 -06:00
Benjamin Drung
3f4dbb1f5a Fix test cases with PermissionError on /var/cache
Some test cases fail when run without root permission, because they want
to read/write to `/var/cache`:

```
python3 -m pytest -ra tests/pytests/unit/state/test_state_format_slots.py
```

`test_format_slots_parallel` fails with:

```
Process ParallelState(always-changes-and-succeeds):
Traceback (most recent call last):
  File "/usr/lib/python3.9/multiprocessing/process.py", line 315, in _bootstrap
    self.run()
  File "salt/utils/process.py", line 996, in wrapped_run_func
    return run_func()
  File "/usr/lib/python3.9/multiprocessing/process.py", line 108, in run
    self._target(*self._args, **self._kwargs)
  File "salt/state.py", line 2023, in _call_parallel_target
    with salt.utils.files.fopen(tfile, "wb+") as fp_:
  File "salt/utils/files.py", line 385, in fopen
    f_handle = open(*args, **kwargs)  # pylint: disable=resource-leakage
FileNotFoundError: [Errno 2] No such file or directory: '/var/cache/salt/minion/123/174993d470c5f21b548d929d1904021966cb279f'
```

fixes #61148
Signed-off-by: Benjamin Drung <bdrung@debian.org>
2022-07-13 13:18:21 -06:00
Gareth J. Greenaway
4449286632 When current_zone_only is True, ensure we append the -G options to the cmd_prefix list correctly 2022-07-13 13:15:19 -06:00
Pablo Suárez Hernández
d6740631ae
Improvements on "ansiblegate" module (#60056)
* Allow collecting Ansible Inventory from a minion

* Prevent crashing if ansible-playbook doesn't return JSON

* Add new 'ansible.discover_playbooks' method

* Include custom inventory when discovering Ansible playbooks

* Enhance 'ansible.discover_playbooks' to accept a list of locations

* Remove unused constants from Ansible utils

* Avoid string concatenation to calculate extra cmd args

* Add unit test for ansible.targets

* Add changes suggested by pre-commit

* Fix issue dealing with ungrouped targets on inventory

* Enable ansible utils for ansible roster tests

* Add tests for new ansiblegate module functions

* Improve Ansible roster targetting

* Remove unnecessary code from Ansible utils

* Add changelog

* Fix pylint issue

* Fix issue in documentation

* Fix issue parsing errors in ansiblegate state module

* Fix typo

* Better error handling on ansible.targets

* Fix lint issue

* Add pre-commit changes and missing import after rebase

* Fix pylint issues

* Add missing functions to ansible __load__

* Properly get separated copies from list

* Properly get separated copies from list

* Use explicit arguments names and avoid __utils__

* Set ANSIBLE_DEPRECATION_WARNINGS to False to avoid breaking execution

* Add missing env ANSIBLE_DEPRECATION_WARNINGS to playbooks function

* Add missing versionadded tags

* Update versions to 3006

Co-authored-by: Megan Wilhite <mwilhite@vmware.com>
2022-07-12 06:59:51 -06:00
Pedro Algarvio
483682e17a Follow up to https://github.com/saltstack/salt/pull/62303
Signed-off-by: Pedro Algarvio <palgarvio@vmware.com>
2022-07-12 10:09:09 +01:00