From a12cbeac3bfde7a9166b3e18604fdcc1c3db204d Mon Sep 17 00:00:00 2001 From: Slavi Pantaleev Date: Thu, 6 Oct 2022 19:48:11 +0300 Subject: [PATCH] Fix async commands Fixes a regression introduced in d1b5681ba0f523. Looks like `.finished` is a property on the main object, not on some `.async_result` object. --- roles/matrix-postgres/tasks/import_postgres.yml | 4 ++-- roles/matrix-postgres/tasks/run_vacuum.yml | 4 ++-- .../tasks/rust-synapse-compress-state/compress_room.yml | 8 ++++---- .../tasks/rust-synapse-compress-state/main.yml | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/roles/matrix-postgres/tasks/import_postgres.yml b/roles/matrix-postgres/tasks/import_postgres.yml index 965719e4..40877e0b 100644 --- a/roles/matrix-postgres/tasks/import_postgres.yml +++ b/roles/matrix-postgres/tasks/import_postgres.yml @@ -108,5 +108,5 @@ async: "{{ postgres_import_wait_time }}" poll: 10 register: matrix_postgres_import_postgres_command_result - failed_when: not matrix_postgres_import_postgres_command_result.async_result.finished - changed_when: matrix_postgres_import_postgres_command_result.async_result.finished and matrix_postgres_import_postgres_command_result.rc == 0 + failed_when: not matrix_postgres_import_postgres_command_result.finished + changed_when: matrix_postgres_import_postgres_command_result.finished and matrix_postgres_import_postgres_command_result.rc == 0 diff --git a/roles/matrix-postgres/tasks/run_vacuum.yml b/roles/matrix-postgres/tasks/run_vacuum.yml index efe69a83..aafa761d 100644 --- a/roles/matrix-postgres/tasks/run_vacuum.yml +++ b/roles/matrix-postgres/tasks/run_vacuum.yml @@ -78,8 +78,8 @@ async: "{{ postgres_vacuum_wait_time }}" poll: 10 register: matrix_postgres_synapse_vacuum_result - failed_when: not matrix_postgres_synapse_vacuum_result.async_result.finished - changed_when: matrix_postgres_synapse_vacuum_result.async_result.finished and matrix_postgres_synapse_vacuum_result.rc == 0 + failed_when: not matrix_postgres_synapse_vacuum_result.finished + changed_when: matrix_postgres_synapse_vacuum_result.finished and matrix_postgres_synapse_vacuum_result.rc == 0 # Intentionally show the results - ansible.builtin.debug: var="matrix_postgres_synapse_vacuum_result" diff --git a/roles/matrix-synapse/tasks/rust-synapse-compress-state/compress_room.yml b/roles/matrix-synapse/tasks/rust-synapse-compress-state/compress_room.yml index ff42cbc4..6ae016fc 100644 --- a/roles/matrix-synapse/tasks/rust-synapse-compress-state/compress_room.yml +++ b/roles/matrix-synapse/tasks/rust-synapse-compress-state/compress_room.yml @@ -21,8 +21,8 @@ async: "{{ matrix_synapse_rust_synapse_compress_state_compress_room_time }}" poll: 10 register: matrix_synapse_rust_synapse_compress_state_compress_room_command_result - failed_when: not matrix_synapse_rust_synapse_compress_state_compress_room_command_result.async_result.finished - changed_when: matrix_synapse_rust_synapse_compress_state_compress_room_command_result.async_result.finished and matrix_synapse_rust_synapse_compress_state_compress_room_command_result.rc == 0 + failed_when: not matrix_synapse_rust_synapse_compress_state_compress_room_command_result.finished + changed_when: matrix_synapse_rust_synapse_compress_state_compress_room_command_result.finished and matrix_synapse_rust_synapse_compress_state_compress_room_command_result.rc == 0 - ansible.builtin.debug: var="matrix_synapse_rust_synapse_compress_state_compress_room_command_result" @@ -45,8 +45,8 @@ async: "{{ matrix_synapse_rust_synapse_compress_state_psql_import_time }}" poll: 10 register: matrix_synapse_rust_synapse_compress_state_psql_import_command_result - failed_when: not matrix_synapse_rust_synapse_compress_state_psql_import_command_result.async_result.finished - changed_when: matrix_synapse_rust_synapse_compress_state_psql_import_command_result.async_result.finished and matrix_synapse_rust_synapse_compress_state_psql_import_command_result.rc == 0 + failed_when: not matrix_synapse_rust_synapse_compress_state_psql_import_command_result.finished + changed_when: matrix_synapse_rust_synapse_compress_state_psql_import_command_result.finished and matrix_synapse_rust_synapse_compress_state_psql_import_command_result.rc == 0 - name: Clean up ansible.builtin.file: diff --git a/roles/matrix-synapse/tasks/rust-synapse-compress-state/main.yml b/roles/matrix-synapse/tasks/rust-synapse-compress-state/main.yml index dcf9eed9..b48e6077 100644 --- a/roles/matrix-synapse/tasks/rust-synapse-compress-state/main.yml +++ b/roles/matrix-synapse/tasks/rust-synapse-compress-state/main.yml @@ -70,7 +70,7 @@ async: "{{ matrix_synapse_rust_synapse_compress_state_find_rooms_command_wait_time }}" poll: 10 register: matrix_synapse_rust_synapse_compress_state_find_rooms_command_result - failed_when: not matrix_synapse_rust_synapse_compress_state_find_rooms_command_result.async_result.finished + failed_when: not matrix_synapse_rust_synapse_compress_state_find_rooms_command_result.finished changed_when: false # We expect the output to be like this: