diff options
author | Abhijeet Kasurde <akasurde@redhat.com> | 2024-09-26 21:05:57 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-09-26 21:05:57 +0200 |
commit | 34f8f55d9e5a85d21207cc174f88eb2d62edd119 (patch) | |
tree | 2f40c3b38845ada74ee51ec76c02da37f3ccbe2e /lib | |
parent | package/dnf action plugins: better facts failure msg (#83995) (diff) | |
download | ansible-34f8f55d9e5a85d21207cc174f88eb2d62edd119.tar.xz ansible-34f8f55d9e5a85d21207cc174f88eb2d62edd119.zip |
facts: Skip path if the distribution path is directory (#84012)
* facts: Skip path if the distribution path is directory
Skip path if the distribution path is directory instead of file.
Handle exception raised while handling distribution path.
Fixes: #84006
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
* Review requests
---------
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/ansible/module_utils/facts/system/distribution.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/ansible/module_utils/facts/system/distribution.py b/lib/ansible/module_utils/facts/system/distribution.py index 76f49b6ce8..7554ef1ae3 100644 --- a/lib/ansible/module_utils/facts/system/distribution.py +++ b/lib/ansible/module_utils/facts/system/distribution.py @@ -30,7 +30,7 @@ def get_uname(module, flags=('-v')): def _file_exists(path, allow_empty=False): # not finding the file, exit early - if not os.path.exists(path): + if not os.path.isfile(path): return False # if just the path needs to exists (ie, it can be empty) we are done |