From 5816be550b59b70cc62dd16af32b2adc02142e86 Mon Sep 17 00:00:00 2001 From: Dmitry Tantsur Date: Tue, 24 May 2022 09:45:32 +0200 Subject: [PATCH] Provide a work around to fix the CI Somehow, openstacksdk ends up logging to stdout. Strip the log message before parsing it as JSON. Change-Id: Id8e635de7bd8a246af7ae1750a556b752dd7dc85 --- playbooks/integration/exercise.yaml | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/playbooks/integration/exercise.yaml b/playbooks/integration/exercise.yaml index e069788..3542232 100644 --- a/playbooks/integration/exercise.yaml +++ b/playbooks/integration/exercise.yaml @@ -29,8 +29,16 @@ - "{{ ssh_key_file }}" user_name: "{{ configure_instance_user | default('') }}" +# FIXME(dtantsur): openstacksdk issues a deprecation warning here, which +# somehow ends up in stdout, presumably because of Zuul quirks. +# Hack around it while we're solving the issue. - name: Get instance info via CLI show - command: metalsmith --format=json show test + shell: | + errout="$(mktemp)" + if ! metalsmith --format=json show test 2> "$errout"; then + cat "$errout" + exit 1 + fi register: instance_info - name: Register instance information @@ -38,8 +46,16 @@ instance: "{{ (instance_info.stdout | from_json).test }}" failed_when: instance.state != 'active' or instance.node.provision_state != 'active' +# FIXME(dtantsur): openstacksdk issues a deprecation warning here, which +# somehow ends up in stdout, presumably because of Zuul quirks. +# Hack around it while we're solving the issue. - name: Get instance info via CLI list - command: metalsmith --format=json list + shell: | + errout="$(mktemp)" + if ! metalsmith --format=json list 2> "$errout"; then + cat "$errout" + exit 1 + fi register: instance_info_via_list - name: Verify that instance info via list is also correct