From ba6e0fc6de01a601a80ccdddc6a2db6fd4691fba Mon Sep 17 00:00:00 2001 From: Ignacio Heredia Date: Tue, 10 Dec 2024 14:59:38 +0100 Subject: [PATCH] fix(oscar): fix deepaas version retrieval --- etc/oscar.yaml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/etc/oscar.yaml b/etc/oscar.yaml index 2137e69e..205d5e72 100644 --- a/etc/oscar.yaml +++ b/etc/oscar.yaml @@ -74,7 +74,8 @@ script: |- required = "2.5.0" # minimum required DEEPaaS version out = subprocess.run(["deepaas-cli", "--version"], stdout=subprocess.PIPE) - current = out.stdout.decode("utf-8").split(" ")[0].split("-")[0] + last_line = out.stdout.decode("utf-8").strip().split("\n")[-1] + current = last_line.split("-")[0] # remove '-dev' from version number if compare_versions(required, current) == 1: print(f"Error: DEEPaaS version must be >={required}. Current version is: {current}") @@ -127,7 +128,7 @@ script: |- print("Something went wrong during the execution.") exit(1) EOF - + if grep -q 'New output is' "service.log" then FILE_NAME_2=`cat service.log | grep 'New output is' | cut -f 5 -d ' '`