Fix unit test helpers for ansible-core 2.19+

ansible-core 2.19 introduced _ANSIBLE_PROFILE alongside _ANSIBLE_ARGS.
set_module_args() in utils.py and test_baremetal_port_group.py only set
_ANSIBLE_ARGS, causing "No serialization profile was specified" errors.
Set _ANSIBLE_PROFILE to 'legacy' to match the pre-2.19 behavior.

Change-Id: I1073f347ce18f061b5fa099442a6b6aa10c42507
Signed-off-by: Bertrand Lanson <bertrand.lanson@infomaniak.com>
This commit is contained in:
Bertrand Lanson
2026-05-19 20:38:34 +02:00
parent 836d7410b2
commit 7644aeaf32
2 changed files with 7 additions and 52 deletions

View File

@@ -14,6 +14,7 @@ def set_module_args(args):
args = json.dumps({'ANSIBLE_MODULE_ARGS': args})
basic._ANSIBLE_ARGS = to_bytes(args)
basic._ANSIBLE_PROFILE = 'legacy'
class AnsibleExitJson(Exception):