From bcb9b7fd4a656f9a6741220a6623441567ded0a4 Mon Sep 17 00:00:00 2001
From: "Allan Douglas R. de Oliveira" <allan@chaordicsystems.com>
Date: Sun, 4 May 2014 20:36:51 -0700
Subject: [PATCH] EC2 script should exit with non-zero code on UsageError

This is specially import because some ssh errors are raised as UsageError, preventing an automated usage of the script from detecting the failure.

Author: Allan Douglas R. de Oliveira <allan@chaordicsystems.com>

Closes #638 from douglaz/ec2_exit_code_fix and squashes the following commits:

5915e6d [Allan Douglas R. de Oliveira] EC2 script should exit with non-zero code on UsageError
---
 ec2/spark_ec2.py | 1 +
 1 file changed, 1 insertion(+)

diff --git a/ec2/spark_ec2.py b/ec2/spark_ec2.py
index db393748a3..0f6d5a1fa8 100755
--- a/ec2/spark_ec2.py
+++ b/ec2/spark_ec2.py
@@ -814,6 +814,7 @@ def main():
     real_main()
   except UsageError, e:
     print >> stderr, "\nError:\n", e
+    sys.exit(1)
 
 
 if __name__ == "__main__":
-- 
GitLab