-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-10532][EC2]Added --profile option to specify the name of profile #8696
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 3 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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)") | ||
| parser.add_option( | ||
| "-t", "--instance-type", default="m1.large", | ||
| help="Type of instance to launch (default: %default). " + | ||
|
|
@@ -1311,7 +1314,10 @@ def real_main(): | |
| sys.exit(1) | ||
|
|
||
| try: | ||
| conn = ec2.connect_to_region(opts.region) | ||
| if opts.profile != "default": | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. LGTM. |
||
| 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) | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Space before
(There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.