Browse Source

Fix issue when noise neaks into get_python_info.py script stdout

Change-Id: I36f9e80199115b628993814f8751ce834f84f467
changes/71/789171/1
Federico Ressi 6 months ago
parent
commit
1cb0c3d814
  1. 3
      roles/tobiko-ensure-python3/files/get_python_info.py
  2. 7
      roles/tobiko-ensure-python3/tasks/install.yaml

3
roles/tobiko-ensure-python3/files/get_python_info.py

@ -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)

7
roles/tobiko-ensure-python3/tasks/install.yaml

@ -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"

Loading…
Cancel
Save