mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-08-03 20:54:24 -07:00
modules/capabilities.py: fail & propagate if getcap command error
This commit is contained in:
parent
6d67546902
commit
d816c5bd41
1 changed files with 2 additions and 0 deletions
|
@ -123,6 +123,8 @@ class CapabilitiesModule(object):
|
||||||
if ' =' in stdout:
|
if ' =' in stdout:
|
||||||
# process output of an older version of libcap
|
# process output of an older version of libcap
|
||||||
caps = stdout.split(' =')[1].strip().split()
|
caps = stdout.split(' =')[1].strip().split()
|
||||||
|
elif stdout.strip().endswith(")"): # '/foo (Error Message)'
|
||||||
|
self.module.fail_json(msg="Unable to get capabilities of %s" % path, stdout=stdout.strip(), stderr=stderr)
|
||||||
else:
|
else:
|
||||||
# otherwise, we have a newer version here
|
# otherwise, we have a newer version here
|
||||||
# see original commit message of cap/v0.2.40-18-g177cd41 in libcap.git
|
# see original commit message of cap/v0.2.40-18-g177cd41 in libcap.git
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue