Fix NexusKeywords to autorelease URLs 37/53737/4
authorVratko Polak <vrpolak@cisco.com>
Thu, 23 Mar 2017 17:02:29 +0000 (18:02 +0100)
committerJamo Luhrsen <jluhrsen@redhat.com>
Thu, 23 Mar 2017 17:25:45 +0000 (17:25 +0000)
Autorelease staging directories
do not have metadata for timestamps to parse.

Change-Id: I8904aaa1584e92adbca0ae6af8b69948ac2300fc
Signed-off-by: Vratko Polak <vrpolak@cisco.com>
csit/libraries/NexusKeywords.robot

index 7458312b047c4363a99bf79d97afae7554df4e17..a15406b9dbab945d15faeff536e3418d9e718be9 100644 (file)
@@ -104,10 +104,11 @@ Deploy_Artifact
     ${version}    ${location} =    NexusKeywords__Detect_Version_To_Pull    ${component}
     # TODO: Use RequestsLibrary and String instead of curl and bash utilities?
     ${url} =    BuiltIn.Set_Variable    ${urlbase}/${location}/${artifact}/${version}
+    # TODO: Review SSHKeywords for current best keywords to call.
     ${metadata} =    SSHKeywords.Execute_Command_Should_Pass    curl -L ${url}/maven-metadata.xml
-    ${namepart} =    SSHKeywords.Execute_Command_Should_Pass    echo "${metadata}" | grep value | head -n 1 | cut -d '>' -f 2 | cut -d '<' -f 1    stderr_must_be_empty=${True}
+    ${status}    ${namepart} =    BuiltIn.Run_Keyword_And_Ignore_Error    SSHKeywords.Execute_Command_Should_Pass    echo "${metadata}" | grep value | head -n 1 | cut -d '>' -f 2 | cut -d '<' -f 1    stderr_must_be_empty=${True}
     ${length} =    BuiltIn.Get_Length    ${namepart}
-    ${namepart} =    BuiltIn.Set_Variable_If    ${length} == 0    ${version}    ${namepart}
+    ${namepart} =    BuiltIn.Set_Variable_If    "${status}" != "PASS" or ${length} == 0    ${version}    ${namepart}
     ${filename} =    BuiltIn.Set_Variable    ${name_prefix}${namepart}${name_suffix}
     BuiltIn.Log    ${filename}
     ${url} =    BuiltIn.Set_Variable    ${url}/${filename}