blob: 6386bfe010c967e05d24919e7b309891de58b39a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
Author: John M. Harris Jr. <johnmh@johnmh.me>
Date: Mon Nov 11 00:26:19 2024 -0700
Remove unnecessary warning
On Gentoo systems, this check normally throws unnecessary warnings.
Assume we're using system-provided ansible when the path begins with
"/usr/lib/python-exec/python3."
diff --git a/src/ansiblelint/__main__.py b/src/ansiblelint/__main__.py
index ca4a33b6..c2dd3cef 100755
--- a/src/ansiblelint/__main__.py
+++ b/src/ansiblelint/__main__.py
@@ -461,7 +461,7 @@ def path_inject(own_location: str = "") -> None:
if own_location:
own_location = os.path.realpath(own_location)
parent = Path(own_location).parent
- if (parent / "ansible").exists() and str(parent) not in paths:
+ if not str(parent).startswith("/usr/lib/python-exec/python3.") and (parent / "ansible").exists() and str(parent) not in paths:
inject_paths.append(str(parent))
if not os.environ.get("PYENV_VIRTUAL_ENV", None):
|