summaryrefslogtreecommitdiffstats
path: root/cli/cli.py
diff options
context:
space:
mode:
authorAlejandro Sirgo Rica <asirgo@soleta.eu>2024-03-04 10:43:26 +0100
committerAlejandro Sirgo Rica <asirgo@soleta.eu>2024-03-04 10:43:26 +0100
commite92e38bcca93f32228bb4cd1943e4e0652947326 (patch)
treef3d1af8da13960c1638adbbcbd408c1b798b90c1 /cli/cli.py
parentf26a8c3d231f202aa2c468d96971f0d80172f393 (diff)
remove whitespace printed after every command execution
The POST handling logic didn't check for empty responses before printing its contents resulting in a line of whitespace being written in the output of the program.
Diffstat (limited to 'cli/cli.py')
-rw-r--r--cli/cli.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/cli/cli.py b/cli/cli.py
index 81dd846..9e5ad04 100644
--- a/cli/cli.py
+++ b/cli/cli.py
@@ -47,7 +47,9 @@ class OgREST():
r = requests.post(f'{self.URL}{path}',
headers=self.HEADERS,
json=payload)
- print(r.text)
+ if r.text:
+ print(r.text)
+
if r.status_code not in {200, 202}:
sys.exit(f"Unsuccessful request to ogServer: "
f"Response with {r.status_code} HTTP status code")