You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by be...@apache.org on 2011/06/05 07:01:41 UTC

svn commit: r1131721 - /incubator/mesos/trunk/src/ec2/nexus_ec2.py

Author: benh
Date: Sun Jun  5 05:01:41 2011
New Revision: 1131721

URL: http://svn.apache.org/viewvc?rev=1131721&view=rev
Log:
Added get-master command to EC2 script.

Modified:
    incubator/mesos/trunk/src/ec2/nexus_ec2.py

Modified: incubator/mesos/trunk/src/ec2/nexus_ec2.py
URL: http://svn.apache.org/viewvc/incubator/mesos/trunk/src/ec2/nexus_ec2.py?rev=1131721&r1=1131720&r2=1131721&view=diff
==============================================================================
--- incubator/mesos/trunk/src/ec2/nexus_ec2.py (original)
+++ incubator/mesos/trunk/src/ec2/nexus_ec2.py Sun Jun  5 05:01:41 2011
@@ -16,7 +16,7 @@ from tempfile import NamedTemporaryFile
 
 def parse_args():
   parser = OptionParser(usage="nexus-ec2 [options] <action> <cluster_name>"
-      + "\n\n<action> can be: launch, shutdown, login",
+      + "\n\n<action> can be: launch, shutdown, login, get-master",
       add_help_option=False)
   parser.add_option("-h", "--help", action="help",
                     help="Show this help message and exit")
@@ -300,6 +300,12 @@ def main():
       proxy_opt = "-D " + opts.proxy_port
     subprocess.check_call("ssh -o StrictHostKeyChecking=no -i %s %s root@%s" %
         (opts.identity_file, proxy_opt, master), shell=True)
+  elif action == "get-master":
+    (master_res, slave_res) = get_existing_cluster(conn, opts, cluster_name)
+    print master_res.instances[0].public_dns_name
+  else:
+    print >> STDERR, "Invalid action: %s" % action
+    sys.exit(1)
 
 
 if __name__ == "__main__":