Extract instanceUid from Location header, v1.0.9
This commit is contained in:
@@ -95,6 +95,11 @@ def api_test():
|
||||
payload["cfsParams"] = [{"svcOperationCfsParamId": int(k), "paramValue": str(v)} for k, v in params.items()]
|
||||
resp = client.post("/instances", payload)
|
||||
instance_uid = resp.get("instanceUid") or _find_uid(resp)
|
||||
# Location header: /instances/{uid}
|
||||
loc = resp.get("_location", "")
|
||||
if not instance_uid and loc:
|
||||
parts = loc.rstrip("/").split("/")
|
||||
instance_uid = parts[-1] if len(parts[-1]) == 36 else None
|
||||
|
||||
# wait
|
||||
deadline = time.time() + 300
|
||||
|
||||
Reference in New Issue
Block a user