From 7073cce3767c69a5e67adec8851ea982eee17b3c Mon Sep 17 00:00:00 2001 From: Erick Navarro Date: Thu, 18 Jul 2024 14:28:18 -0600 Subject: [PATCH] Print deployment URL on success execution This allow to see deployment details in Kuraka system --- main.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/main.py b/main.py index 603b0e6..bac59ba 100755 --- a/main.py +++ b/main.py @@ -31,8 +31,10 @@ def main(): try: with urlopen(request) as response: if response.status == 201: + uid = response.read().decode().strip() + deployment_url = uri.geturl().replace(uri.path, f"/deployments/{uid}") sys.stdout.write( - f"Deployment created with uid: {response.read().decode()}\n" + f"Deployment created with uid: {uid}, your can see its details in {deployment_url}\n" ) except HTTPError as error: sys.stderr.write(f"HTTP Error: {error.reason} {error.read().decode()}")