summaryrefslogtreecommitdiffstats
path: root/src/ansiblelint/_mockings.py
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-26 06:24:57 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-26 06:24:57 +0000
commit1faea9a6c75f33109e8f66b57b432fdad57b3f46 (patch)
tree4184ce38ac0cf9d5a46bbbae03c87be82927f12b /src/ansiblelint/_mockings.py
parentAdding upstream version 6.17.2. (diff)
downloadansible-lint-1faea9a6c75f33109e8f66b57b432fdad57b3f46.tar.xz
ansible-lint-1faea9a6c75f33109e8f66b57b432fdad57b3f46.zip
Adding upstream version 24.6.1.upstream/24.6.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/ansiblelint/_mockings.py')
-rw-r--r--src/ansiblelint/_mockings.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/ansiblelint/_mockings.py b/src/ansiblelint/_mockings.py
index e0482b7..5c2a9a7 100644
--- a/src/ansiblelint/_mockings.py
+++ b/src/ansiblelint/_mockings.py
@@ -1,4 +1,5 @@
"""Utilities for mocking ansible modules and roles."""
+
from __future__ import annotations
import contextlib
@@ -46,7 +47,7 @@ def _make_module_stub(module_name: str, options: Options) -> None:
path.mkdir(exist_ok=True, parents=True)
_write_module_stub(
filename=module_file,
- name=module_file,
+ name=module_name,
namespace=namespace,
collection=collection,
)
@@ -122,4 +123,4 @@ def _perform_mockings_cleanup(options: Options) -> None:
else:
path = options.cache_dir / "roles" / role_name
with contextlib.suppress(OSError):
- path.unlink()
+ path.rmdir()