You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spark.apache.org by pw...@apache.org on 2014/06/23 05:56:08 UTC

git commit: SPARK-2166 - Listing of instances to be terminated before the prompt

Repository: spark
Updated Branches:
  refs/heads/master 9fc373e3a -> 9cb64b2c5


SPARK-2166 - Listing of instances to be terminated before the prompt

Will list the EC2 instances before detroying the cluster.
This was added because it can be scary to destroy EC2
instances without knowing which one will be impacted.

Author: Jean-Martin Archer <je...@pulseenergy.com>

This patch had conflicts when merged, resolved by
Committer: Patrick Wendell <pw...@gmail.com>

Closes #270 from j-martin/master and squashes the following commits:

826455f [Jean-Martin Archer] [SPARK-2611] Implementing recommendations
27b0a36 [Jean-Martin Archer] Listing of instances to be terminated before the prompt Will list the EC2 instances before detroying the cluster. This was added because it can be scary to destroy EC2 instances without knowing which one will be impacted.


Project: http://git-wip-us.apache.org/repos/asf/spark/repo
Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/9cb64b2c
Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/9cb64b2c
Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/9cb64b2c

Branch: refs/heads/master
Commit: 9cb64b2c54b35eed373f54c2103f679b04e9af1e
Parents: 9fc373e
Author: Jean-Martin Archer <je...@pulseenergy.com>
Authored: Sun Jun 22 20:52:02 2014 -0700
Committer: Patrick Wendell <pw...@gmail.com>
Committed: Sun Jun 22 20:54:42 2014 -0700

----------------------------------------------------------------------
 ec2/spark_ec2.py | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/spark/blob/9cb64b2c/ec2/spark_ec2.py
----------------------------------------------------------------------
diff --git a/ec2/spark_ec2.py b/ec2/spark_ec2.py
index a40311d..e80f928 100755
--- a/ec2/spark_ec2.py
+++ b/ec2/spark_ec2.py
@@ -770,12 +770,16 @@ def real_main():
         setup_cluster(conn, master_nodes, slave_nodes, opts, True)
 
     elif action == "destroy":
-        response = raw_input("Are you sure you want to destroy the cluster " +
-                             cluster_name + "?\nALL DATA ON ALL NODES WILL BE LOST!!\n" +
-                             "Destroy cluster " + cluster_name + " (y/N): ")
+        print "Are you sure you want to destroy the cluster %s?" % cluster_name
+        print "The following instances will be terminated:"
+        (master_nodes, slave_nodes) = get_existing_cluster(
+            conn, opts, cluster_name, die_on_error=False)
+        for inst in master_nodes + slave_nodes:
+            print "> %s" % inst.public_dns_name
+
+        msg = "ALL DATA ON ALL NODES WILL BE LOST!!\nDestroy cluster %s (y/N): " % cluster_name
+        response = raw_input(msg)
         if response == "y":
-            (master_nodes, slave_nodes) = get_existing_cluster(
-                conn, opts, cluster_name, die_on_error=False)
             print "Terminating master..."
             for inst in master_nodes:
                 inst.terminate()