[PR #10145/3daa1dec backport][stable-10] Fix TypeError caused by giving more than 2 positional arguments to CobblerXMLRPCInterface.get_system_handle() (#10158)
Some checks are pending
EOL CI / EOL Sanity (Ⓐ2.15) (push) Waiting to run
EOL CI / EOL Units (Ⓐ2.15+py2.7) (push) Waiting to run
EOL CI / EOL Units (Ⓐ2.15+py3.10) (push) Waiting to run
EOL CI / EOL Units (Ⓐ2.15+py3.5) (push) Waiting to run
EOL CI / EOL I (Ⓐ2.15+alpine3+py:azp/posix/1/) (push) Waiting to run
EOL CI / EOL I (Ⓐ2.15+alpine3+py:azp/posix/2/) (push) Waiting to run
EOL CI / EOL I (Ⓐ2.15+alpine3+py:azp/posix/3/) (push) Waiting to run
EOL CI / EOL I (Ⓐ2.15+fedora37+py:azp/posix/1/) (push) Waiting to run
EOL CI / EOL I (Ⓐ2.15+fedora37+py:azp/posix/2/) (push) Waiting to run
EOL CI / EOL I (Ⓐ2.15+fedora37+py:azp/posix/3/) (push) Waiting to run
nox / Run extra sanity tests (push) Waiting to run

Fix TypeError caused by giving more than 2 positional arguments to CobblerXMLRPCInterface.get_system_handle()  (#10145)

* Update cobbler system module to also use new get_system_handle method definition

* Add changelog for bug fix for cobbler system module

(cherry picked from commit 3daa1dec0c)

Co-authored-by: umiruka <211638667+umiruka@users.noreply.github.com>
This commit is contained in:
patchback[bot] 2025-05-18 22:45:39 +02:00 committed by GitHub
parent 4c6f77cbc5
commit edb0d5f6ca
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 9 additions and 1 deletions

View file

@ -0,0 +1,2 @@
bugfixes:
- cobbler_system - fix bug with Cobbler >= 3.4.0 caused by giving more than 2 positional arguments to ``CobblerXMLRPCInterface.get_system_handle()`` (https://github.com/ansible-collections/community.general/issues/8506, https://github.com/ansible-collections/community.general/pull/10145).

View file

@ -161,6 +161,8 @@ from ansible.module_utils.common.text.converters import to_text
from ansible_collections.community.general.plugins.module_utils.datetime import (
now,
)
from ansible_collections.community.general.plugins.module_utils.version import LooseVersion
IFPROPS_MAPPING = dict(
bondingopts='bonding_opts',
@ -278,6 +280,10 @@ def main():
if system:
# Update existing entry
system_id = None
if LooseVersion(str(conn.version())) >= LooseVersion('3.4.0'):
system_id = conn.get_system_handle(name)
else:
system_id = conn.get_system_handle(name, token)
for key, value in iteritems(module.params['properties']):