diff options
author | Alejandro Sirgo Rica <asirgo@soleta.eu> | 2024-03-04 10:43:26 +0100 |
---|---|---|
committer | Alejandro Sirgo Rica <asirgo@soleta.eu> | 2024-03-04 10:43:26 +0100 |
commit | e92e38bcca93f32228bb4cd1943e4e0652947326 (patch) | |
tree | f3d1af8da13960c1638adbbcbd408c1b798b90c1 /cli/cli.py | |
parent | f26a8c3d231f202aa2c468d96971f0d80172f393 (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.py | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -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") |