Work around ODCS creating COMPOSE_ID later
When ODCS starts a compose, it will provide base composeinfo file, but it doesn't create COMPOSE_ID. This leads to a crash when updating CTS, since the compose id can't be read from the file. We can instead use the value we already have in memory. Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
This commit is contained in:
parent
0530cf2712
commit
ac061b2ea8
@ -150,11 +150,9 @@ def write_compose_info(compose_dir, ci):
|
||||
ci.dump(os.path.join(work_dir, "composeinfo-base.json"))
|
||||
|
||||
|
||||
def update_compose_url(compose_dir, conf):
|
||||
def update_compose_url(compose_id, compose_dir, conf):
|
||||
import requests
|
||||
|
||||
with open(os.path.join(compose_dir, "COMPOSE_ID"), "r") as f:
|
||||
compose_id = f.read()
|
||||
authentication = get_authentication(conf)
|
||||
cts_url = conf.get("cts_url", None)
|
||||
if cts_url:
|
||||
|
@ -329,7 +329,7 @@ def main():
|
||||
notifier=notifier,
|
||||
)
|
||||
|
||||
rv = Compose.update_compose_url(compose_dir, conf)
|
||||
rv = Compose.update_compose_url(compose.compose_id, compose_dir, conf)
|
||||
if rv and not rv.ok:
|
||||
logger.error("CTS compose_url update failed with the error: %s" % rv.text)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user