Compare commits

...

6 Commits
4.0.0 ... 4.0.1

Author SHA1 Message Date
Felix Fontein
ac3e803a36 Release 4.0.1. 2021-11-09 17:03:04 +01:00
Felix Fontein
8168ddca4f Prepare 4.0.1. 2021-11-09 08:02:15 +01:00
patchback[bot]
cc264be644 Replace Fedora 33 with Fedora 35 for devel tests (#3674) (#3680)
* Replace Fedora 33 with Fedora 35 for devel tests.

* Skip Fedora 35 for reiserfs tests.

(cherry picked from commit fc99893f10)

Co-authored-by: Felix Fontein <felix@fontein.de>
2021-11-09 06:54:06 +01:00
patchback[bot]
9bd2d1ec90 Better handling of base64-encoded values in xattr module (#3675) (#3678)
* Fix exception in xattr module when existing extended attribute's value contains non-printable characters and the base64-encoded string contains a '=' sign

* Added changelog fragment for #3675

* Apply suggestions from code review

Co-authored-by: Felix Fontein <felix@fontein.de>
(cherry picked from commit 2f0ae0408d)

Co-authored-by: sc-anssi <sc-anssi@users.noreply.github.com>
2021-11-09 06:29:09 +01:00
patchback[bot]
01b2c48161 a_module test: fix crash in case of tombstoning (#3660) (#3662)
* Fix crash in case of tombstoning.

* Extend tests.

(cherry picked from commit c23bbb5c4a)

Co-authored-by: Felix Fontein <felix@fontein.de>
2021-11-04 13:02:18 +01:00
Felix Fontein
a26792418e Next expected release will be 4.1.0. 2021-11-02 07:08:36 +01:00
9 changed files with 63 additions and 13 deletions

View File

@@ -297,10 +297,10 @@ stages:
targets:
- name: CentOS 7
test: centos7
- name: Fedora 33
test: fedora33
- name: Fedora 34
test: fedora34
- name: Fedora 35
test: fedora35
- name: openSUSE 15 py2
test: opensuse15py2
- name: openSUSE 15 py3

View File

@@ -6,6 +6,20 @@ Community General Release Notes
This changelog describes changes after version 3.0.0.
v4.0.1
======
Release Summary
---------------
Bugfix release for today's Ansible 5.0.0 beta 1.
Bugfixes
--------
- a_module test plugin - fix crash when testing a module name that was tombstoned (https://github.com/ansible-collections/community.general/pull/3660).
- xattr - fix exception caused by ``_run_xattr()`` raising a ``ValueError`` due to a mishandling of base64-encoded value (https://github.com/ansible-collections/community.general/issues/3673).
v4.0.0
======

View File

@@ -1027,3 +1027,16 @@ releases:
name: a_module
namespace: null
release_date: '2021-11-02'
4.0.1:
changes:
bugfixes:
- a_module test plugin - fix crash when testing a module name that was tombstoned
(https://github.com/ansible-collections/community.general/pull/3660).
- xattr - fix exception caused by ``_run_xattr()`` raising a ``ValueError``
due to a mishandling of base64-encoded value (https://github.com/ansible-collections/community.general/issues/3673).
release_summary: Bugfix release for today's Ansible 5.0.0 beta 1.
fragments:
- 3660-a_module-tombstone.yml
- 3675-xattr-handle-base64-values.yml
- 4.0.1.yml
release_date: '2021-11-09'

View File

@@ -1,6 +1,6 @@
namespace: community
name: general
version: 4.0.0
version: 4.0.1
readme: README.md
authors:
- Ansible (https://github.com/ansible)

View File

@@ -158,7 +158,7 @@ def _run_xattr(module, cmd, check_rc=True):
if line.startswith('#') or line == '':
pass
elif '=' in line:
(key, val) = line.split('=')
(key, val) = line.split('=', 1)
result[key] = val.strip('"')
else:
result[line] = ''

View File

@@ -7,6 +7,11 @@ __metaclass__ = type
from ansible.plugins.loader import action_loader, module_loader
try:
from ansible.errors import AnsiblePluginRemovedError
except ImportError:
AnsiblePluginRemovedError = Exception
def a_module(term):
"""
@@ -14,14 +19,17 @@ def a_module(term):
- 'community.general.ufw' is community.general.a_module
- 'community.general.does_not_exist' is not community.general.a_module
"""
for loader in (action_loader, module_loader):
data = loader.find_plugin(term)
# Ansible 2.9 returns a tuple
if isinstance(data, tuple):
data = data[0]
if data is not None:
return True
return False
try:
for loader in (action_loader, module_loader):
data = loader.find_plugin(term)
# Ansible 2.9 returns a tuple
if isinstance(data, tuple):
data = data[0]
if data is not None:
return True
return False
except AnsiblePluginRemovedError:
return False
class TestModule(object):

View File

@@ -45,6 +45,9 @@
- 'not (ansible_distribution in ["CentOS", "RedHat"] and item.0.key in ["f2fs", "reiserfs"])'
- 'not (ansible_os_family == "RedHat" and ansible_distribution_major_version is version("8", ">=") and
item.0.key == "btrfs")'
# reiserfs-utils package not available with Fedora 35 on CI
- 'not (ansible_distribution == "Fedora" and (ansible_facts.distribution_major_version | int >= 35) and
item.0.key == "reiserfs")'
# ocfs2 only available on Debian based distributions
- 'not (item.0.key == "ocfs2" and ansible_os_family != "Debian")'
# Tests use losetup which can not be used inside unprivileged container

View File

@@ -44,7 +44,7 @@
name: reiserfs-utils
state: present
when:
- ansible_distribution == 'Fedora'
- ansible_distribution == 'Fedora' and (ansible_facts.distribution_major_version | int < 35)
- name: "Install reiserfs (OpenSuse)"
ansible.builtin.package:

View File

@@ -23,3 +23,15 @@
# Local collection module (that exist or not)
- "'testns.testcoll.collection_module' is community.general.a_module"
- "'testns.testcoll.foobar' is not community.general.a_module"
- name: Test a_module in case of routing
assert:
that:
# Redirected module
- "'ufw' is community.general.a_module"
# Redirected module where target collection does not exist
# (the target collection must not have been installed in CI!)
- "'onyx_pfc_interface' is not community.general.a_module"
# Tombstoned module
- "'community.general.docker_image_facts' is not community.general.a_module"
when: ansible_version.string is version('2.10.0', '>=')