Fix issue when noise neaks into get_python_info.py script stdout

Change-Id: I36f9e80199115b628993814f8751ce834f84f467
This commit is contained in:
Federico Ressi 2021-05-03 11:24:43 +02:00
parent ed84b3fcd6
commit 1cb0c3d814
2 changed files with 7 additions and 3 deletions

View File

@ -50,7 +50,8 @@ def main():
info = {'version': version,
'executable': sys.executable,
'executables': executables}
output = json.dumps(info, indent=4, sort_keys=True)
output = json.dumps(info)
assert output.startswith('{')
print(output)

View File

@ -34,14 +34,17 @@
cmd: get_python_info.py --base --quiet
executable: '{{ get_python_exe.stdout_lines | first }}'
register: get_python_info
changed_when: no
changed_when: false
- name: "set python_info['{{ python_command }}'] fact"
set_fact:
python_info: >
{{ python_info | combine({python_command:
(get_python_info.stdout | from_json)}) }}
(item | from_json)}) }}
loop: '{{ get_python_info.stdout_lines }}'
when: item.startswith('{')
failed_when: (python_info | length) == 0
- name: "upgrade '{{ python_command }}' packages to the latest versions"