open(path) throws an error when called on a directory or UNIX socket,
and therefore a check to ensure that the path is absent will always
succeed when there is a directory or file located there.
This updates the check to use os.access(path, os.F_OK) instead, which
instead just checks that the path exists instead of trying to open it as
a file, and therefore properly handles directories and sockets.
This causes a slight semantic change in how permissions are handled.
The existing code will fail to work correctly if the user running the
module on the managed host has no read access to the path specified.
The new code will work correctly in that situation.
Both versions fail if the user can't traverse the parent directory.
I've also added a check to the try block to catch OSError. I've seen
this call fail with an OSError on rare occasion in the face of odd
extended permissions (usually MAC configuration) in cases where it
should technically return False. In such cases, the file is functionally
inaccessible to the user making the call, so it's essentially not there,
but it can't be created by them either. I've documented this, as well as
the fact that the bug this change fixes exists, and a rather nasty
inconsistency involving symbloic handling that I stumbled across while
testing this change.
Fixes: #20870
* vmware_host: add reconnect and add_or_reconnect states
Add "reconnect" and "add_or_reconnect" choices for "state".
* reconnect: reconnect an esxi to a vcenter (imply it is present).
* add_or_reconnect: do the same but add the esxi if absent.
Also:
* tag the cluster_name as required (because it is).
* tag esxi_username and esxi_password as not required because
they aren't when the esxi isn't added.
* vmware_host: add + prepare/document integration tests
vmware_host module
Add integration test for the add part of "add_or_reconnect" state.
Prepare and document integration tests for the reconnect part
of "add_or_reconnect" state and "reconnect" and "absent" states.
Currently we can't test those states as ReconnectHost_Task (for
"reconnect") and EnterMaintenanceMode_Task (for "absent") aren't
implemented yet in vcsim (from vmware/govmomi)
* Readded vital return parameters to the ec2_asg that have been spared for no obvious reason
* Fix typo in ec2_asg docs
* Fixing another typo in ec2_asg docs.
* TestPlaybookCLI: '--flush-cache' were ignored
Check that using '--flush-cache' does something
* check that '_flush_cache' does something
There isn't any fact by default: the assertion was true even if
'cli._flush_cache()' isn't called.
* Fixing save so it still works. Adding changed as an option for save_when.
* Updating unit tests.
* Updating description to state that changed was added in 2.5.
* Added new module: Azure RM SQL Servers
* fixed sanity issues
* enabled integration test
* disabling test as Microsoft.Sql namespace not available
* renamed servers -> server
* updates as requested in the review
* udpates to sql server
* renamed module
* replaced has_key by in
* flattened results
* final updates to sql server
* updates as requested in the review
* added more tests
* deleting unexisting instance up front
* more tests
* another round of test changes
* removed uneeded test
* Change cast_list_to_dict to more generic rekey_on_member
cast_list_to_dict was taking an arbitrary data format in and returning
an arbitrary data format out. Rework this to be a more generic function
which creates a dict of dicts based on a member of the dict.
Remove cast_dict_to_list since rekey_on_member handles the use cases we
know about and cast_dict_to_list suffers from the same problems as
cast_list_to_dict. If this is still needed we could think about filters
we could add to do this in a short jinja2 pipeline.
* Fix bare excepts (bare excepts even catch sys.exit())
Previously if a child's group vars section was defined before the
child group itself, an edge case would be hit where the state of the
pending declaration would process as var and therefore drop the
child pending declaration context. This would result in the group
vars defined for the parent group being out of scope for the child
group.
Example:
[web:children]
appnodes
proxies
[web:vars]
deployment_type=prod
[appnodes:vars]
foo_var=true
[appnodes]
appnodes[1:3].example.com
[proxies:vars]
bar_var=true
[proxies]
proxies[1:3].example.com
Previously the deployment_type variable would be out of scope for
both the appnodes and proxies groups. This patch fixes that.
Signed-off-by: Adam Miller <maxamillion@fedoraproject.org>
* allow multiple values per key in name fields in openssl_certificate
* check correct side of comparison
* trigger only on lists
* add subject parameter to openssl_csr
* fix key: value mapping not skipping None elements
* temporary fix for undefined "subject" field
* fix iteration over subject entries
* fix docs
* quote sample string
* allow csr with only subject defined
* fix integration test
* look up NIDs before comparing, add hidden _strict params
* deal with empty issuer/subject fields
* adapt integration tests
* also normalize output from pyopenssl
* fix issue with _sanitize_inputs
* don't convert empty lists
* workaround for pyopenssl limitations
* properly encode the input to the txt2nid function
* another to_bytes fix
* make subject, commonname and subjecAltName completely optional
* don't compare hashes of keys in openssl_csr integration tests
* add integration test for old API in openssl_csr
* compare keys directly in certificate and publickey integration tests
* fix typo
This fix adds following:
* Documentation update
* Add support for DHCP
* Refactor code to use PyVmomi class
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
* firewalld: Implement zone operations
Zones are removed or added when no other operations are used in
conjunction with the keywords 'present' or 'absent'.
This leads to a logical and natural syntax of:
- firewalld:
zone: foo
state: present
for adding or removing zones.
Signed-off-by: Felix Kaechele <felix@kaechele.ca>
* firewalld: zone ops: addressed review concerns
- Added more documentation on the peculiarities of the zone operations
- Output meaningful error messages when trying to use zones incorrectly
Signed-off-by: Felix Kaechele <felix@kaechele.ca>
* ACI Encap Pool: Add new module to support VLAN, VXLAN, and VSAN Pools
* update logic for allocation_mode
* update docstring and tests
* Update filter_target since url method has been updated