Skip to content
Closed
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion ec2/spark_ec2.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,9 @@ def parse_args():
parser.add_option(
"-i", "--identity-file",
help="SSH private key file to use for logging into instances")
parser.add_option(
"-p", "--profile", default="default",
help=" If you have multiple profiles(aws or boto config), you can configure additional, named profiles by using this option (default: %default)")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Space before (

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

parser.add_option(
"-t", "--instance-type", default="m1.large",
help="Type of instance to launch (default: %default). " +
Expand Down Expand Up @@ -1311,7 +1314,10 @@ def real_main():
sys.exit(1)

try:
conn = ec2.connect_to_region(opts.region)
if opts.profile != "default":
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What if I wanted to have a profile that's named "default"? I think it would better to have None as the default and to replace this with an is not None check.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.
I will fix this quickly

conn = ec2.connect_to_region(opts.region, profile_name=opts.profile)
else:
conn = ec2.connect_to_region(opts.region)
except Exception as e:
print((e), file=stderr)
sys.exit(1)
Expand Down