[PR #10455/bd84f654 backport][stable-11] Improve capabilities module by detecting /sbin/getcap error message and stop early with a meaningful error message (#10563)

Improve capabilities module by detecting /sbin/getcap error message and stop early with a meaningful error message (#10455)

* modules/capabilities.py: fail & propagate if getcap command error

* Fix comment spacing (pep8)

* Add changelogs fragment for PR 10455

* Update changelogs/fragments/10455-capabilities-improve-error-detection.yml



---------



(cherry picked from commit bd84f65456)

Co-authored-by: hakril <github@hakril.net>
Co-authored-by: clement rouault <clement.rouault@exatrack.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
This commit is contained in:
patchback[bot] 2025-08-02 17:00:34 +02:00 committed by GitHub
commit 87a213225d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 4 additions and 0 deletions

View file

@ -0,0 +1,2 @@
bugfixes:
- capabilities - using invalid path (symlink/directory/...) returned unrelated and incoherent error messages (https://github.com/ansible-collections/community.general/issues/5649, https://github.com/ansible-collections/community.general/pull/10455).