From ea2f08e8ea40b119f83a7059c5b1ed6b889d0950 Mon Sep 17 00:00:00 2001 From: Felix Fontein Date: Sun, 30 Nov 2025 14:27:51 +0100 Subject: [PATCH] Remove no longer needed _mount module util. --- LICENSES/PSF-2.0.txt | 48 -------------------------- README.md | 2 +- changelogs/fragments/11232-mount.yml | 6 ++++ plugins/module_utils/_mount.py | 50 ---------------------------- plugins/modules/aix_filesystem.py | 2 +- 5 files changed, 8 insertions(+), 100 deletions(-) delete mode 100644 LICENSES/PSF-2.0.txt create mode 100644 changelogs/fragments/11232-mount.yml delete mode 100644 plugins/module_utils/_mount.py diff --git a/LICENSES/PSF-2.0.txt b/LICENSES/PSF-2.0.txt deleted file mode 100644 index 35acd7fb5ff..00000000000 --- a/LICENSES/PSF-2.0.txt +++ /dev/null @@ -1,48 +0,0 @@ -PYTHON SOFTWARE FOUNDATION LICENSE VERSION 2 --------------------------------------------- - -1. This LICENSE AGREEMENT is between the Python Software Foundation -("PSF"), and the Individual or Organization ("Licensee") accessing and -otherwise using this software ("Python") in source or binary form and -its associated documentation. - -2. Subject to the terms and conditions of this License Agreement, PSF hereby -grants Licensee a nonexclusive, royalty-free, world-wide license to reproduce, -analyze, test, perform and/or display publicly, prepare derivative works, -distribute, and otherwise use Python alone or in any derivative version, -provided, however, that PSF's License Agreement and PSF's notice of copyright, -i.e., "Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, -2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021 Python Software Foundation; -All Rights Reserved" are retained in Python alone or in any derivative version -prepared by Licensee. - -3. In the event Licensee prepares a derivative work that is based on -or incorporates Python or any part thereof, and wants to make -the derivative work available to others as provided herein, then -Licensee hereby agrees to include in any such work a brief summary of -the changes made to Python. - -4. PSF is making Python available to Licensee on an "AS IS" -basis. PSF MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR -IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, PSF MAKES NO AND -DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS -FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF PYTHON WILL NOT -INFRINGE ANY THIRD PARTY RIGHTS. - -5. PSF SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF PYTHON -FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS -A RESULT OF MODIFYING, DISTRIBUTING, OR OTHERWISE USING PYTHON, -OR ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF. - -6. This License Agreement will automatically terminate upon a material -breach of its terms and conditions. - -7. Nothing in this License Agreement shall be deemed to create any -relationship of agency, partnership, or joint venture between PSF and -Licensee. This License Agreement does not grant permission to use PSF -trademarks or trade name in a trademark sense to endorse or promote -products or services of Licensee, or any third party. - -8. By copying, installing or otherwise using Python, Licensee -agrees to be bound by the terms and conditions of this License -Agreement. diff --git a/README.md b/README.md index 7e3777ed9dd..9fca50ab046 100644 --- a/README.md +++ b/README.md @@ -139,6 +139,6 @@ This collection is primarily licensed and distributed as a whole under the GNU G See [LICENSES/GPL-3.0-or-later.txt](https://github.com/ansible-collections/community.general/blob/main/COPYING) for the full text. -Parts of the collection are licensed under the [BSD 2-Clause license](https://github.com/ansible-collections/community.general/blob/main/LICENSES/BSD-2-Clause.txt), the [MIT license](https://github.com/ansible-collections/community.general/blob/main/LICENSES/MIT.txt), and the [PSF 2.0 license](https://github.com/ansible-collections/community.general/blob/main/LICENSES/PSF-2.0.txt). +Parts of the collection are licensed under the [BSD 2-Clause license](https://github.com/ansible-collections/community.general/blob/main/LICENSES/BSD-2-Clause.txt) and the [MIT license](https://github.com/ansible-collections/community.general/blob/main/LICENSES/MIT.txt). All files have a machine readable `SDPX-License-Identifier:` comment denoting its respective license(s) or an equivalent entry in an accompanying `.license` file. Only changelog fragments (which will not be part of a release) are covered by a blanket statement in `REUSE.toml`. This conforms to the [REUSE specification](https://reuse.software/spec/). diff --git a/changelogs/fragments/11232-mount.yml b/changelogs/fragments/11232-mount.yml new file mode 100644 index 00000000000..9710170af8b --- /dev/null +++ b/changelogs/fragments/11232-mount.yml @@ -0,0 +1,6 @@ +bugfixes: + - "aix_filesystem - remove compatibility code for ancient Python versions (https://github.com/ansible-collections/community.general/pull/11232)." +minor_changes: + - "The last code included in the collection that was licensed under the PSF 2.0 license was removed form the collection. + This means that now all code is either GPLv3+ licensed, MIT licensed, or BSD-2-clause licensed + (https://github.com/ansible-collections/community.general/pull/11232)." diff --git a/plugins/module_utils/_mount.py b/plugins/module_utils/_mount.py deleted file mode 100644 index d3ab3ac4a18..00000000000 --- a/plugins/module_utils/_mount.py +++ /dev/null @@ -1,50 +0,0 @@ -# This code is part of Ansible, but is an independent component. -# This particular file snippet, and this file snippet only, is based on -# Lib/posixpath.py of cpython -# -# Copyright (c) 2001-2022 Python Software Foundation. All rights reserved. -# It is licensed under the PYTHON SOFTWARE FOUNDATION LICENSE VERSION 2 -# (See LICENSES/PSF-2.0.txt in this collection) -# SPDX-License-Identifier: PSF-2.0 - -from __future__ import annotations - - -import os - - -def ismount(path): - """Test whether a path is a mount point - This is a copy of the upstream version of ismount(). Originally this was copied here as a workaround - until Python issue 2466 was fixed. Now it is here so this will work on older versions of Python - that may not have the upstream fix. - https://github.com/ansible/ansible-modules-core/issues/2186 - http://bugs.python.org/issue2466 - """ - try: - s1 = os.lstat(path) - except (OSError, ValueError): - # It doesn't exist -- so not a mount point. :-) - return False - else: - # A symlink can never be a mount point - if os.path.stat.S_ISLNK(s1.st_mode): - return False - - if isinstance(path, bytes): - parent = os.path.join(path, b"..") - else: - parent = os.path.join(path, "..") - parent = os.path.realpath(parent) - try: - s2 = os.lstat(parent) - except (OSError, ValueError): - return False - - dev1 = s1.st_dev - dev2 = s2.st_dev - if dev1 != dev2: - return True # path/.. on a different device as path - ino1 = s1.st_ino - ino2 = s2.st_ino - return ino1 == ino2 # path/.. is the same i-node as path diff --git a/plugins/modules/aix_filesystem.py b/plugins/modules/aix_filesystem.py index 5a4693a4c08..a29ba9542e8 100644 --- a/plugins/modules/aix_filesystem.py +++ b/plugins/modules/aix_filesystem.py @@ -165,7 +165,7 @@ from ansible.module_utils.basic import AnsibleModule -from ansible_collections.community.general.plugins.module_utils._mount import ismount +from os.path import ismount import re