]> git.ipfire.org Git - thirdparty/patchwork.git/commitdiff
Fix return code when getting patch information fails
authorAli Alnubani <alialnu@mellanox.com>
Tue, 8 Jan 2019 12:38:45 +0000 (12:38 +0000)
committerStephen Finucane <stephen@that.guru>
Mon, 25 Feb 2019 10:15:43 +0000 (10:15 +0000)
The `info` command always exits with success, even if
the patch didn't exist.
Modified to exit with a non-zero exit status and
print an error message in that case.

Signed-off-by: Ali Alnubani <alialnu@mellanox.com>
Reviewed-by: Stephen Finucane <stephen@that.guru>
patchwork/bin/pwclient

index 2cff3a35359cbda45fc519faf50676190a39440b..43c7a37392ec0a6b134158d22ac9f0ae8b0494bc 100755 (executable)
@@ -275,6 +275,12 @@ def action_states(rpc):
 
 def action_info(rpc, patch_id):
     patch = rpc.patch_get(patch_id)
+
+    if patch == {}:
+        sys.stderr.write("Error getting information on patch ID %d\n" %
+                         patch_id)
+        sys.exit(1)
+
     s = "Information for patch id %d" % (patch_id)
     print(s)
     print('-' * len(s))