action: more debugging information (#85839)

* action: more debugging information

* Allow user to identify underlying problem with chmod, setfacl
  command.

Signed-off-by: Abhijeet Kasurde <Akasurde@redhat.com>

* Review requests

Signed-off-by: Abhijeet Kasurde <Akasurde@redhat.com>

* Review requests

Signed-off-by: Abhijeet Kasurde <Akasurde@redhat.com>

* Review requests

Signed-off-by: Abhijeet Kasurde <Akasurde@redhat.com>

---------

Signed-off-by: Abhijeet Kasurde <Akasurde@redhat.com>
pull/85899/head
Abhijeet Kasurde 4 months ago committed by GitHub
parent 1e572ba5cc
commit 5fc4b8c106
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -671,8 +671,18 @@ class ActionBase(ABC, _AnsiblePluginInfoMixin):
become_user,
setfacl_mode)
if res['rc'] == 0:
return remote_paths
match res.get('rc'):
case 0:
return remote_paths
case 2:
# invalid syntax (for example, missing user, missing colon)
self._display.debug(f"setfacl command failed with an invalid syntax. Trying chmod instead. Err: {res!r}")
case 127:
# setfacl binary does not exists or we don't have permission to use it.
self._display.debug(f"setfacl binary does not exist or does not have permission to use it. Trying chmod instead. Err: {res!r}")
case _:
# generic debug message
self._display.debug(f'Failed to set facl {setfacl_mode}, got:{res!r}')
# Step 3b: Set execute if we need to. We do this before anything else
# because some of the methods below might work but not let us set

Loading…
Cancel
Save