Commit graph

51673 commits

Author SHA1 Message Date
Matt Clay
7b0c4845d9 Remove PyYAML warning filter in import test.
The filter is obsolete now that PyYAML imports go through our compat layer.
2021-05-10 16:57:45 -07:00
Matt Clay
bdffb59978
Update Python versions used to run network tests. (#74647) 2021-05-10 15:06:09 -07:00
Matt Clay
d85809d592 Update Python versions used to run Windows tests. 2021-05-10 10:30:41 -07:00
Brian Coca
7f7d3067e3
adhoc clarify help (#74616)
also added comments to code
2021-05-10 13:28:59 -04:00
Sloane Hertel
ee725846f0
ansible-galaxy - increase page size and add retry decorator for throttling (#74240)
* Get available collection versions with page_size=100 for v2 and limit=100 for v3

* Update unit tests for larger page sizes

* Add a generic retry decorator in module_utils/api.py that accepts an Iterable of delays and a callable to determine if an exception inheriting from Exception should be retried

* Use the new decorator to handle Galaxy API rate limiting

* Add unit tests for new retry decorator

* Preserve the decorated function's metadata with functools.wraps

Co-authored-by: Matt Martz <matt@sivel.net>
Co-authored-by: Sviatoslav Sydorenko <wk.cvs.github@sydorenko.org.ua>
2021-05-10 13:26:41 -04:00
Matt Clay
51fd05e76b Add support for testing with Python 3.10. 2021-05-10 08:23:15 -07:00
Matt Clay
bcb64054ed
Another unit test fix for Python 3.10. (#74628)
* Another unit test fix for Python 3.10.
* Add missing __init__.py file.
2021-05-07 17:26:41 -07:00
Matt Clay
d4413dac08 Fix unit tests on Python 3.10. 2021-05-07 16:56:30 -07:00
Ruediger Pluem
2f7e0b8489
user - consistently create user home directory on Linux (#71952)
Always use create_homedir when we are asked to create a home directory
in the User class. Don't use the -m and -k parameters from
useradd / luseradd as they behave differently with respect to
preexisting home directories. Instead always specify -M to ensure
that useradd / luseradd do not try to create the home directory.

This does not change potential different behaviours in child classes
of the User class.

Consider the new umask option from #73821 in create_homedir as well as
we do not let luseradd / useradd create the home directory any longer.
2021-05-07 17:00:10 -04:00
Matt Clay
2e97240c67 Ignore more Python 3.10 warnings in import test. 2021-05-07 11:19:22 -07:00
Sloane Hertel
69f3447b6b
Remove 'default:' from config settings (#74607) 2021-05-07 10:31:32 -04:00
René Moser
403a5d147d
modules: get_url: Fix checksum binary validation (#74502)
From the sha512sum man page:

... The default mode is to print a line with checksum, a character indicating type ('*' for binary, ' ' for text), and name for each FILE.
2021-05-07 10:29:22 -04:00
Abhijeet Kasurde
4d7dc15d4e
service - compare version without LooseVersion (#74508)
The distutils module is not shipped with SUNWPython on Solaris.
It's in the SUNWPython-devel package. Do not use LooseVersion.

Fixes: #74488

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2021-05-07 10:22:00 -04:00
Jordan Borean
a277644301
Add python 3.10 constraint for pyspnego (#74612) 2021-05-06 23:53:50 -07:00
Matt Clay
e6d7aecbe4
Reorganize more ansible-test code. (#74611)
* Split out shell command.
* Relocate ansible-test integration code.
2021-05-06 17:59:07 -07:00
Matt Clay
065fc3ca17 Remove check for legacy core and extras dirs. 2021-05-06 17:58:25 -07:00
Matt Clay
5487e9e4fd Update runtime-metadata sanity test for Python 3.10. 2021-05-06 15:12:06 -07:00
Brian Coca
8cccabf1eb
cron: removal of deprecations and minor fix (#73591)
* removal of deprecations and minor fix

  name or cron_file is required.
  reboot was removed.
  updated docs to clarify usage.
  now using cron_file=/etc/crontab is an error

  fixes #37355
2021-05-06 18:05:06 -04:00
Matt Clay
cbac26e500 Update import sanity test for Python 3.10. 2021-05-06 14:55:41 -07:00
Matt Clay
2c3a3bdd9c Update pylint sanity test to work on Python 3.10. 2021-05-06 14:46:12 -07:00
Matt Clay
c2e15f45a6 Update ansible-test compile sanity test.
The test has been rewritten to improve error handling and add support for Python 3.10.
2021-05-06 13:51:45 -07:00
Brian Coca
35ff4ea95b
warn on walking through pathing issues (#74514)
* warn show pathing issues when wallking through provided paths

  moved issues from msg to actual warnings AND a specific return field

  fixes #25314

Co-authored-by: Sam Doran <sdoran@redhat.com>
2021-05-06 16:14:33 -04:00
Andrew Klychkov
5463cbb841
Docs: communication.rst - add ansible-community to the IRC channel list (#74570) 2021-05-06 15:10:53 -04:00
Sam Doran
55b401a3e7
pause - ensure control characters are always set appropriately (#74568)
* pause - ensure control characters are always set appropriately

On some systems, curses.tigetstr() returns None, which does not work as a control character.

* Add unit tests

* Sort imports

* Skip on older Python

This is an action plugin and only runs on the controller, so no need to test of Python 2. Making
the import hackery work on Python 2 would required some more work which I am not sure is
worth it since we are moving away from Python 2 support on the controller.

* Make the tests work on Python 2 and 3
2021-05-06 15:09:26 -04:00
Felix Fontein
a6cc508822
Update the module lifecycle document to also cover plugins and collections (#74413)
Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
2021-05-06 10:16:43 -04:00
Baptiste Mille-Mathias
74647a1314
systemd doc update (#74442)
Document that systemd module manages units (timers, services, ...) and not only service. (#74442)

Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
Co-authored-by: Brian Coca <bcoca@users.noreply.github.com>
2021-05-06 09:49:42 +05:30
Joseph Jacobs
dcb807dea7
Update cli_parsing.rst (#74555)
Bad indent in an example
2021-05-06 09:34:07 +05:30
Matt Clay
07fb6f7547 Fix imports for the previous commit.
Also add a changelog entry.
2021-05-05 18:56:29 -07:00
Matt Clay
92c40f6365 Relocate change classification files. 2021-05-05 18:56:29 -07:00
Matt Clay
5dfc7ee078 Remove Shippable CI provider from ansible-test. 2021-05-05 17:42:13 -07:00
Matt Clay
8bd599d048 Change Shippable refs in docs to Azure Pipelines. 2021-05-05 17:21:48 -07:00
Matt Clay
c48f80d062 Rename hacking/shippable to hacking/azp.
References to Shippable were changed to Azure Pipelines.

Also remove rebalance.py as it does not work with Azure Pipelines due to the required data not being present.
2021-05-05 17:21:14 -07:00
Matt Clay
df2ae06d46 Fix ansible-test imports and paths after refactor.
Also include a changelog entry covering this commit and the previous.
2021-05-05 16:20:15 -07:00
Matt Clay
bb3904d299 Reorganize command implementations.
This commit only renames existing files.

Changes to adapt imports will occur in a follow-up commit.
2021-05-05 16:20:15 -07:00
Sloane Hertel
aea0c4dd1b
Fix inventory cache prefix typos (#74523)
* Fix section for inventory cache prefix

* Redirect general config inventory cache options to inventory plugin documentation

* Update the template to fix the docs-build error

* removes 'default' entries for config settings with default: ''

* single backticks => italics, double backticks => code

* use 'Default: ~' to match other entries that have no default setting

Co-authored-by: Alicia Cozine <acozine@users.noreply.github.com>
2021-05-05 13:27:40 -04:00
Abhijeet Kasurde
38dd49eb00
ansible-inventory: Handle exception in toml parsing (#74486)
Handle stacktrace raise while parsing inventory in toml format

Fixes: #74404

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2021-05-05 14:12:52 +05:30
Matt Clay
68e9e1c999
Switch incidental OS X tests to macOS. (#74564)
* Switch incidental OS X tests to macOS.
* Rename incidental osx.sh to macos.sh.
2021-05-04 11:46:46 -07:00
Miro Hrončok
728b52a6ff
Use /usr/bin/python3 on rhelish 9+ (#74547)
The /usr/libexec/platform-python symbolic link is just a backwards compatibility shim there.

See ce226d00fa
2021-05-04 12:48:16 -04:00
Abhijeet Kasurde
4627c30b2e
interpreter_discovery: Hide warning in auto_silent (#74509)
Hide warning "No python interpreters" in auto_silent mode.

Fixes: #74274

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2021-05-04 12:01:49 -04:00
Rick Elrod
b0389c7f11
[cli] remove superfluous trailing space from help (#74551)
Change:
- After we output the newline in help text, we also added a space. This
  caused either a space to show up before the shell prompt (in shells
  like bash), or " %" and a newline before the next prompt on shells
  like zsh that automatically force commands to end with a newline.
- This change removes the extra space, so that peace can be restored in
  the minds of many.
- This only showed up when running commands with no arguments or invalid
  arguments.

Test Plan:
- Ran `ansible`, `ansible -h`, `ansible-playbook`, `ansible-galaxy`, and
  `ansible-galaxy -h`.

Tickets:
- Introduced in #69458

Signed-off-by: Rick Elrod <rick@elrod.me>
2021-05-04 11:42:17 -04:00
David Shrewsbury
c6fda9fc1a
[coverage] improve test coverage for together lookup (#74549) 2021-05-04 11:41:22 -04:00
David Shrewsbury
4f0a9488bb
[coverage] improve test coverage for indexed_items lookup (#74548) 2021-05-04 11:41:02 -04:00
David Shrewsbury
244bf9c640
[coverage] improve test coverage for vars lookup (#74546) 2021-05-04 11:39:04 -04:00
Brian Coca
30912b6a47
dont specify default for port, allow ssh/config (#74526)
* dont specify default for port, allow ssh/config

 also added general note on how defaults work.

Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
Co-authored-by: Sam Doran <sdoran@redhat.com>
2021-05-04 11:09:05 -04:00
Ruairidh MacLeod
d101009688
facts - set correct OS family for Rocky Linux (#74530) 2021-05-04 10:14:13 -04:00
Louis Abel
2d41e5f99a
hostname - add Rocky Linux support (#74545) 2021-05-04 09:11:44 -04:00
Sam Doran
728e43bc59 callback_default test - Reduce sleep time to correct CI failures
For unknown reasons, these tests started failing recently because the results
from testhost11 are being returned before testhost10, but only when coverage is
enabled.

Setting the initial host sleep time to 0 fixes this failure.

ci_coverage
2021-05-03 17:55:10 -07:00
Matt Clay
fb0d5609cb
Code cleanup in ansible-test. (#74529)
* Fix get_available_python_versions calls.
* Make run_playbook vars optional.
* Use ansible_pipelining in inventory.
* Fix type hint.
* Fix order of conditional evaluation.
* Remove unused ibmi platform.
* Add changelog fragment.
2021-04-30 18:50:00 -07:00
Matt Clay
ca507ff477 Integration test fixes. 2021-04-30 17:59:28 -07:00
Maxim Masiutin
daecb30ac9
The apt_key module did not properly handle GnuPG errors for certain actions (#74478)
* Not all GnuPG return codes were analyzed (rc != 0) and not all relevant GnuPG error information was returned by the 'ansible.builtin.apt_key' module (https://github.com/ansible/ansible/issues/74477)

* Update changelogs/fragments/74478-apt_key-gpg-error-check.yaml

Co-authored-by: Brian Coca <bcoca@users.noreply.github.com>
Co-authored-by: Sam Doran <sdoran@redhat.com>
2021-04-30 16:53:41 -04:00