* Changes as per review comments and renamed file to vmware_content_library_info
* Removing password field from publish info dictionary
* Removed current password field from publish info
* Modified vmware_content_library_info module with review comments.
* Review comments. Moved test .yml files under tasks folder
* Moved test files under module name folder. Handled library_get call under try catch to throw proper error message
* Fixed precheck failure bare except. Catching Exception
* Fix reported AIX filesystem module incorrect fail_json() usage and
extend reporting on an error.
Fixes#58609
* pep8 and ansible-test fixes, as well one missed msg param
ansible-test only passes files which have the .py suffix for sanity
tests on python files. This change will allow sanity tests to run on
the Python files in hacking/
* Rename test-module to test-module.py
* Symlink test-module for backwards compat since end users may be using
test-module
* Fix test-module sanity errors that are now triggered
* Rename ansible_profile to ansible-profile.py
* Rename build-ansible
* cosmetic: Remove useless call to ec2_argument_spec()
* aws_s3: Improve ETag handling
* Extract ETag calculation into a utility function for reuse by
aws_s3_sync.
* Reduce code duplication in put/get by restructuring the logic
* Only calculate ETag when overwrite == different
* Fail gracefully when overwrite == different and MD5 isn't available
(e.g. due to FIPS-140-2).
* aws_s3: clean up integration tests
Clean up tests, add tests for overwrite settings in both directions.
* Add msg parameter to the mandatory filter
The `mandatory` filter would be more useful, particularly when dealing with nested dictionaries, with the simple addition of a `msg` parameter for supplying it with a custom failure message.
In "status: present" playbook execution for a VDO volume that is
absent, all of the parameters that are given in the playbook are
issued to the "vdo create" command, therefore any parameters that
become "unrecognized" will result in the "vdo" command returning an
error with the message "unrecognized arguments", which can then be
relayed back to the user. This is a gracefully handled failure case.
Examples of "unrecognized" parameters are new features that are not
yet in the current version of VDO, or features that were removed
since the current version of VDO.
In "status: present" playbook execution for a VDO volume that is
already present, the same behavior as the "creation" stage of the
module should occur, but doesn't occur, since the key strings for
the "vdo status" output of the parameter do not exist. This results
in a KeyError on the parameter that no longer exists.
Therefore, use "if statfield in processedvdos[desiredvdo]:" to filter
the modifiable parameters with the ones that are supported in this
VDO version, then use "if statfield not in processedvdos[desiredvdo]:"
to evade the KeyError, and add the "unsupported" parameters.
Also, instead of using the "currentvdoparams" dictionary, which
filters only the parameters reported by the "vdo status" output, use
the "modtrans" dictionary, which contains all of the possible
parameters. Therefore, if the playbook specifies an "unsupported"
parameter, let it be passed on to the "vdo" command, to display an
actionable error message.
This fixes https://github.com/ansible/ansible/issues/54556
Signed-off-by: Bryan Gurney <bgurney@redhat.com>
* Use `compile` before `eval` in collection loader.
This fixes two issues:
1. File names are available when tracing execution, such as with code coverage.
2. Future statements are not inherited from the collection loader.
* Add unit tests for collection loading.
These tests verify several things:
1. That unit tests can import code from collections when the collection loader is installed.
2. That tracing reports the correct file and line numbers (to support code coverage).
3. That collection code does not inherit __future__ statements from the collection loader.
* Update unit test handling of the collection loader.
Since the collection loader is installed simply by importing ansible.plugins.loader,
we may already have a collection loader installed when the test runs. This occurs if
any other tests are collected which use that import during collection. Until that code
is moved into an initialization function to avoid loading during import, the unit tests
will need to replace any existing collection loaders so that they reflect the desired
configuration.
* Insert into sys.modules before calling exec.
This is a requirement of PEP 302.
It will prevent recursion errors when importing the current module or using a relative import.
* Use the correct value for __package__ in modules.
This allows using relative imports in collections.
* Add warning about modifying code for trace test.
* Add test for relative import in collection.
* Add __init__.py to collection to satisfy pylint.
The relative-beyond-top-level rule in pylint may not be appropriate for collections.
However, until that rule is disabled for collections this will keep tests passing.
* Fix Pacman regex for unmatched Arch package name
`ansible -m pacman -a upgrade=yes $(hostname)` failed due to not
accounting for the `+` character in the `pacman -Qu` output line:
libsigc++ 2.10.0-1 -> 2.10.1-1
Per the Arch wiki¹, package names can contain alphanumeric characters,
and any of {`@`, `.`, `_`, `+`, `-`}.
The existing `re` covered `_` (part of `\w` in Python), and `-`
(explicitly included). This change adds `@`, `.`, and `+` (in
ASCII-betical order).
¹: https://wiki.archlinux.org/index.php/Arch_package_guidelines#Package_naming
* Add explanation for `pacman -Qu` regex matching
* Remove unneeded non-capturing groups in regex