Staged autorelease does not have to contain some testing
artifacts which are needed for csit.
In that case fallback to using the release repo.
Signed-off-by: Tomas Cere <tomas.cere@pantheon.tech>
Change-Id: If6002e2080d791ce53571de68fd212879f75e0c2
Utility library for retrieving entity related data from ODL.
"""
-from logging import debug, warning
+from logging import info
from requests import post
from sys import argv
auth=("admin", "admin"),
)
- debug(
+ info(
"Response %s ",
resp,
)
name,
)
- debug("Data %s", data)
+ info("Data %s", data)
resp = post(
url=restconf_url + """/operations/odl-entity-owners:get-entity""",
auth=("admin", "admin"),
)
- warning(
- "Response %s ",
- resp,
- )
-
- warning(
- "Json %s",
+ info(
+ "Entity json %s",
resp.json(),
)
- all_entities = get_entities(restconf_url)
-
- warning(
- "All entities %s",
- all_entities,
- )
-
result = {
"candidates": resp.json()["odl-entity-owners:output"]["candidate-nodes"],
"owner": resp.json()["odl-entity-owners:output"]["owner-node"],
name,
)
- debug("Data %s", data)
+ info("Data %s", data)
resp = post(
url=restconf_url + """/operations/odl-entity-owners:get-entity-owner""",
auth=("admin", "admin"),
)
- debug(
+ info(
"Response %s ",
resp,
)
${url} = BuiltIn.Set_Variable ${url}/${filename}
${response} ${result} = SSHLibrary.Execute_Command wget -q -N '${url}' 2>&1 return_rc=True
BuiltIn.Log ${response}
- BuiltIn.Run_Keyword_If ${result} != 0 BuiltIn.Fail Artifact "${artifact}" in component "${component}" could not be downloaded from ${url}
+ BuiltIn.Return_From_Keyword_If ${result} == 0
+ # staged autorelease for non-mri project might not contain the artifact we need so we need to fallback to grabbing it from the release repo
+ ${release_url} = String.Replace_String_Using_Regexp ${url} autorelease-[0-9]{4} opendaylight.release
+ ${response} ${result} = SSHLibrary.Execute_Command wget -q -N '${release_url}' 2>&1 return_rc=True
+ BuiltIn.Run_Keyword_If ${result} != 0 BuiltIn.Fail Artifact "${artifact}" in component "${component}" could not be downloaded from ${release_url} nor ${url}
[Return] ${filename}
Deploy_Test_Tool