Commit graph

4 commits

Author SHA1 Message Date
Kevin Burke
736e846008 Replace deprecated module_utils imports before ansible-core 2.24 removal
ansible-core 2.20 deprecated `ansible.module_utils._text` and
`ansible.module_utils.common._collections_compat`. Both will be removed
in ansible-core 2.24.

Replace all occurrences across plugins, callbacks, and tests:

- `from ansible.module_utils._text import ...`
  → `from ansible.module_utils.common.text.converters import ...`

- `from ansible.module_utils.common._collections_compat import ...`
  → `from collections.abc import ...`

Also remove the now-unnecessary `pylint:ansible-bad-import-from` entries
from the sanity ignore list for the affected files, and add a unit test
that scans for these deprecated patterns to prevent regressions.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-15 21:52:07 +09:00
Abhijeet Kasurde
ea8fc70373 Fix sanity test for modules
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2021-03-02 18:53:06 +05:30
Abhijeet Kasurde
75a5f83602
Partially revert "mount: Check if src exists before mounted (ansible/ansible#61752)" (#33)
This reverts part of ansible commit 72023d7462e78635264fd12bfdb23894b4163cba.

The immediate reason is that it breaks mounts where src is not a path.
Examples of such mounts are network-based filesystems such as nfs, cifs,
glusterfs, ceph, virtual filesystems such as tmpfs or overlayfs, and
also UUID-based mounts. It is too hard to come with an exhaustive list,
especially if we take non-Linux systems into account, so don't even try.

Additionally, it did not really fix the issue (ansible/ansible#59183) that
it intended to fix, because the mount could fail but leave a non-working
fstab entry for reasons other than non-existing src path.

Restore fstab and remove the mount point after a failed mount

Add a reminder that not only devices can be mounted

Fixes: ansible/ansible#65855
Fixes: ansible/ansible#67588
Fixes: ansible/ansible#67966

Signed-off-by: Alexander E. Patrakov <patrakov@gmail.com>
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>

Co-authored-by: Alexander E. Patrakov <patrakov@gmail.com>
2020-05-29 15:34:53 -05:00
Ansible Core Team
6f928621f0 Initial commit 2020-03-09 13:15:28 +00:00