From 2609fc188ca15ff665a8258f4591470d61acc7f2 Mon Sep 17 00:00:00 2001 From: Luis Presuel Date: Thu, 6 Jun 2024 11:31:12 -0600 Subject: [PATCH] fixes regex reading cloud ID depending if JSON output or not --- .../provision/cloudkeystore/steps_definitions/my_steps.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/aruba/features/provision/cloudkeystore/steps_definitions/my_steps.rb b/aruba/features/provision/cloudkeystore/steps_definitions/my_steps.rb index d605cb25..d6579337 100644 --- a/aruba/features/provision/cloudkeystore/steps_definitions/my_steps.rb +++ b/aruba/features/provision/cloudkeystore/steps_definitions/my_steps.rb @@ -85,14 +85,14 @@ def get_cloud_id_from_output(json = false) end Kernel.puts("Checking output:\n"+@previous_command_output) - cloud_id_attr = "cloudId:" + cloud_id_attr = "cloudId" if json json_string = extract_json_from_output(@previous_command_output) JSON.parse(json_string) cloud_id = unescape_text(normalize_json(json_string, "#{cloud_id_attr}")).tr('"', '') else - m = @previous_command_output.match /#{cloud_id_attr} (.+)$/ + m = @previous_command_output.match /#{cloud_id_attr}: (.+)$/ cloud_id = m[1] end cloud_id