diff options
author | Martin Krizek <martin.krizek@gmail.com> | 2023-04-17 16:23:03 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-04-17 09:23:03 -0500 |
commit | d5a36b8734077de524c1bb090d6179278c1187d6 (patch) | |
tree | 76d1754665b4e17983ae4f7b974f5465cc637d90 /lib | |
parent | 8616d68ea92e12ee66ba9fe8cf59343a6f76a151 (diff) | |
download | ansible-d5a36b8734077de524c1bb090d6179278c1187d6.tar.gz |
Change ansible_job_id format (#79951) (#80282)
* Change ansible_job_id format
...to be something that does not resemble float or other type which
value could be changed by literal_eval that jinja2_native uses.
Specifically the format of '%d.%d' is converted from str to float and
then back to float which may result in truncating the number resulting
in the job not being found because the job id does not exist.
(cherry picked from commit 09e0fb3516a793009a1b2ac8bfcc758016a10c6d)
Diffstat (limited to 'lib')
-rw-r--r-- | lib/ansible/executor/powershell/module_manifest.py | 2 | ||||
-rw-r--r-- | lib/ansible/plugins/action/__init__.py | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/lib/ansible/executor/powershell/module_manifest.py b/lib/ansible/executor/powershell/module_manifest.py index 970e8489e4..87e2ce0ad0 100644 --- a/lib/ansible/executor/powershell/module_manifest.py +++ b/lib/ansible/executor/powershell/module_manifest.py @@ -319,7 +319,7 @@ def _create_powershell_wrapper(b_module_data, module_path, module_args, exec_manifest["actions"].insert(0, 'async_watchdog') exec_manifest["actions"].insert(0, 'async_wrapper') - exec_manifest["async_jid"] = str(random.randint(0, 999999999999)) + exec_manifest["async_jid"] = f'j{random.randint(0, 999999999999)}' exec_manifest["async_timeout_sec"] = async_timeout exec_manifest["async_startup_timeout"] = C.config.get_config_value("WIN_ASYNC_STARTUP_TIMEOUT", variables=task_vars) diff --git a/lib/ansible/plugins/action/__init__.py b/lib/ansible/plugins/action/__init__.py index d199207cce..436fb65ae8 100644 --- a/lib/ansible/plugins/action/__init__.py +++ b/lib/ansible/plugins/action/__init__.py @@ -1125,7 +1125,7 @@ class ActionBase(ABC): remote_files.append(remote_async_module_path) async_limit = self._task.async_val - async_jid = str(random.randint(0, 999999999999)) + async_jid = f'j{random.randint(0, 999999999999)}' # call the interpreter for async_wrapper directly # this permits use of a script for an interpreter on non-Linux platforms |