Commit Graph

1711 Commits

Author SHA1 Message Date
46a1eb6832 [stable-2.13] Prefer unittest.mock over mock. (#77886)
(cherry picked from commit 2595b42aca)

Co-authored-by: Matt Clay <matt@mystile.com>
2022-05-23 14:09:36 -07:00
e3c72230cd unarchive: fix io_buffer_size option, remove ignore.txt entry (#77271)
* Fix io_buffer_size option.

* Remove ignore.txt entry by adding action plugin only options to module's argument spec.

* Add changelog fragment.

* Adjust unit tests.
2022-03-18 05:15:13 +10:00
1a5853d794 Remove obsolete units.compat.mock compat layer. (#77118)
* Remove obsolete units.compat.mock compat layer.
* Update remaining units.compat.mock references.
2022-02-22 18:20:11 -08:00
b145732973 Resubmit: Use SystemdStrategy for Debian in the hostname module (#76929)
* add DebianStrategy tests
* ensure hostname can be changed by using become
* use Systemd strat for debian and Base for generic.
* add test to ensure all strategies are available

Signed-off-by: Thomas Sjögren <konstruktoid@users.noreply.github.com>
2022-02-09 10:26:42 -05:00
3889ddeb4b iptables - added a `chain_management` parameter to control chain (#76378)
creation and deletion

fixes #25099
closes #32158
2022-01-24 12:31:20 -05:00
08af0fbf95 Unbreak hostname.RedHatStrategy (#76032)
- On Python 3, decode bytes to str
- Tolerate whitespace around the line.
- Report a missing HOSTNAME line as an error.
- Don't clobber line separators when setting a new hostname.
- Add some tests for this strategy to verify correct operation.
2021-11-15 07:15:20 +01:00
de01db08d0 pip - Use pip from the current Python interpreter. (#75634)
* pip - Use pip from the current Python interpreter.

If `executable` and `virtualenv` were not specified, and
the `pip` Python module is available for the current interpreter,
use that `pip` module instead of searching for a `pip` command.

* Add comment about needing `__main__` to run `pip`.

* Fix unit test.

* Add porting guide entry.

* Update changelog to match porting guide description.

ci_complete
2021-09-03 15:17:43 -07:00
51f2f1ac5e yum: fix parsing of check-update with subsequent empty lines (#75452)
Rather than adding further complexity to the regex, preprocess the output to
remove any empty lines. Now the only purpose of the regex is to fix
wrapped lines.

Fixes #70949
2021-08-20 11:30:33 -04:00
61900c7672 modules moved to use best_parsable_locale (#75250)
* modules moved to use best_parsable_locale

* fixed invocations

* better better

* also module_utils

* converted to function as per fb

* patch testt

* whitespace
2021-07-15 12:18:01 -07:00
9a21e24778 get_distribution - Return distribution for all platforms (#71641)
Since moving to distro, it is possible to return this information for all platforms, not just Linux.
Also return version information for all platfrom not just Linux.
Update unit tests.
Remove some duplicate unit tests though I think there are more to remove.

* Fix docstring formatting

* Minor docstring changes

* Mock distro.id for Solaris service test

* Update comment
2021-06-11 10:22:18 -04:00
50e998e303 apt_key: add --recv argument as last one (#74949)
* apt_key: add --recv argument as last one

* Add unit test

* Add the required boilerplate

Co-authored-by: Marius Gedminas <marius@gedmin.as>
2021-06-11 05:47:59 +10:00
004c33d9c5 unarchive - do not fail in init when trying to find required binary (#74892)
Test for the required binaries in the can_handle_archive() method and fail there. This
prevents failures for missing binaries unrelated to the archive type.

* Update missing zip binary message to match tar message
* Update unit tests
* Add integration tests
* Define packages based on the system rather than ignoring failures
2021-06-07 12:59:06 -04:00
be9f8c69d1 unarchive: Fail when zipinfo is not available (#74632)
Fixes: #39029

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2021-06-02 10:09:42 +05:30
70f22c7f32 Remove commented code (#74860)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2021-06-01 11:26:38 -04:00
502270c804 hostname: clean up strategies
Apply #74744 and #69929 to #70828
2021-05-27 13:15:52 +02:00
8a0abed1ba [hostname] don't write in get_*() methods
Change:
- Hostname strategies' get_*() methods should never write to the
  filesystem. They are used in check_mode by default to determine if
  there is any work to be done.

Test Plan:
- New unit tests to ensure that (at least when in check_mode) the get
  methods don't ever call write.

Tickets:
- Fixes #66432

Signed-off-by: Rick Elrod <rick@elrod.me>
2021-05-27 13:15:52 +02:00
39bd8b99ec async_wrapper more info on end (#74199)
be consistent on information returned
 normalize 'return functions'
 fix unit test
 add a bit more context on some failures
2021-04-13 10:30:13 -04:00
9c506031fa Solaris: Correct version check in svcadm_supports_sync API (#73860)
Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
2021-04-10 08:02:58 +05:30
846c2d1ed3 Fix comment in iptables unit test (#74061) 2021-03-30 16:11:12 -04:00
be59caa59b iptables: Added set module/match_set support (#72984) 2021-01-11 16:32:53 -05:00
83fb24b923 iptables: Adding multiport module support (#72928) 2020-12-14 10:23:54 -05:00
c1da427a5e iptables: Reorder comment postition (#71496)
* Reorder comment postition

* Add comment unit test

* Fix unit test

* Fix unit test

* Add changelog

* Add paramaters which would be problematic without this fix

* Fix typo

* Fix unit test

* Fix unit test
2020-11-09 19:40:55 +01:00
cdf62edc65 service_facts: return service state information on AIX (#72073)
* service_facts: return service state information on AIX

AIX uses the System Resource Controller (SRC) to manage services.
See https://www.ibm.com/support/knowledgecenter/ssw_aix_72/osmanagement/sysrescon.htm
Use lssrc command on AIX to return service state information.


Co-authored-by: dberg1 <dberg1@github.com>
2020-10-13 11:28:59 -04:00
f5037314e3 sanity: remove ansible-bad-function (#70431)
* Updated docs and ignore.txt
* Replaced with correct function calls

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2020-07-07 11:46:28 -04:00
b019029bf3 Add intentional unit tests for basic._set_cwd and common.dict_merge (#70283)
* Add unit tests for basic._set_cwd

* incidental coverage for dict_merge

* add test for async stderr inclusion
2020-06-25 14:45:13 -05:00
98a0995fd0 Clean up unit test boilerplate. 2020-06-22 14:20:33 -07:00
4c4406b2df Flatten the directory hierarchy of modules (#68966)
* Flatten the directory hierarchy of modules

* Update ignore.txt, flatten units

* Update imports

* Completely flatten the modules directory

* Update sanity ignore

* Fix some sanity test ignores

* Fix relative import

* Fix docs builds without category

* ci_complete

* Clean up docs. ci_complete

* Adjust needs/file alias

* ci_complete

* fix hardcoded ping module paths

Co-authored-by: Matt Davis <mrd@redhat.com>
2020-05-13 19:14:53 -07:00
7e8dae5790 Remove unused unit test files. 2020-03-23 11:14:21 -05:00
e0e57b4beb migration final cleanup 2020-03-23 11:14:21 -05:00
cc2feea51b Migrated to vyos.vyos 2020-03-23 11:14:21 -05:00
40714dfca9 Migrated to openvswitch.openvswitch 2020-03-23 11:14:21 -05:00
36a545553e Migrated to dellemc_networking.os6 2020-03-23 11:14:21 -05:00
bc40fe0b6f Migrated to dellemc_networking.os9 2020-03-23 11:14:21 -05:00
0b633b3703 Migrated to dellemc_networking.os10 2020-03-23 11:14:21 -05:00
35063de590 Migrated to junipernetworks.junos 2020-03-23 11:14:21 -05:00
8ee0187388 Migrated to openstack.cloud 2020-03-23 11:14:21 -05:00
6ce86295c0 Migrated to f5networks.f5_modules 2020-03-23 11:14:21 -05:00
3149db0869 Migrated to cisco.nxos 2020-03-23 11:14:21 -05:00
5aa37733c3 Migrated to cisco.iosxr 2020-03-23 11:14:21 -05:00
7e04b5ba8b Migrated to cisco.ios 2020-03-23 11:14:21 -05:00
ab5a3b4305 Migrated to cisco.asa 2020-03-23 11:14:21 -05:00
14b0ab63ac Migrated to arista.eos 2020-03-23 11:14:21 -05:00
6da1ec1d8c Migrated to check_point.mgmt 2020-03-23 11:14:21 -05:00
f0cf2c159b Migrated to netapp.ontap 2020-03-23 11:14:21 -05:00
cae9d633b0 Migrated to netapp.elementsw 2020-03-23 11:14:21 -05:00
0a9205b7c0 Migrated to netapp.aws 2020-03-23 11:14:21 -05:00
09d8d46983 Migrated to fortinet.fortios 2020-03-23 11:14:21 -05:00
829eb0f1d1 Migrated to ansible.posix 2020-03-23 11:14:21 -05:00
9a7a574ffc Migrated to ansible.netcommon 2020-03-23 11:14:21 -05:00
6d910034a0 Migrated to ansible.amazon 2020-03-23 11:14:21 -05:00