Skip to content

Commit 914cab5

Browse files
committed
add version info
1 parent 85ccee8 commit 914cab5

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

ec2/spark_ec2.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,9 @@
3939
from optparse import OptionParser
4040
from sys import stderr
4141

42+
SPARK_EC2_VERSION = "1.2.0"
43+
SPARK_EC2_DIR = os.path.dirname(os.path.realpath(__file__))
44+
4245
VALID_SPARK_VERSIONS = set([
4346
"0.7.3",
4447
"0.8.0",
@@ -54,9 +57,8 @@
5457
"1.2.0",
5558
])
5659

57-
DEFAULT_SPARK_VERSION = "1.2.0"
60+
DEFAULT_SPARK_VERSION = SPARK_EC2_VERSION
5861
DEFAULT_SPARK_GITHUB_REPO = "https://github.com/apache/spark"
59-
SPARK_EC2_DIR = os.path.dirname(os.path.realpath(__file__))
6062
MESOS_SPARK_EC2_BRANCH = "branch-1.3"
6163

6264
# A URL prefix from which to fetch AMI information
@@ -103,12 +105,10 @@ class UsageError(Exception):
103105
# Configure and parse our command-line arguments
104106
def parse_args():
105107
parser = OptionParser(
106-
usage="spark-ec2 [options] <action> <cluster_name>"
107-
+ "\n\n<action> can be: launch, destroy, login, stop, start, get-master, reboot-slaves",
108-
add_help_option=False)
109-
parser.add_option(
110-
"-h", "--help", action="help",
111-
help="Show this help message and exit")
108+
prog="spark-ec2",
109+
version="%prog {v}".format(v=SPARK_EC2_VERSION),
110+
usage="%prog [options] <action> <cluster_name>\n\n"
111+
+ "<action> can be: launch, destroy, login, stop, start, get-master, reboot-slaves")
112112
parser.add_option(
113113
"-s", "--slaves", type="int", default=1,
114114
help="Number of slaves to launch (default: %default)")

0 commit comments

Comments
 (0)