Skip to content

Commit

Permalink
Add back support for --endpoint-url option. Fixes #209.
Browse files Browse the repository at this point in the history
  • Loading branch information
garnaat committed Aug 8, 2013
1 parent c8616ff commit d6c46df
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
4 changes: 3 additions & 1 deletion awscli/clidriver.py
Original file line number Diff line number Diff line change
Expand Up @@ -772,7 +772,9 @@ def __init__(self, session):
self._session = session

def invoke(self, operation_object, parameters, parsed_globals):
endpoint = operation_object.service.get_endpoint(parsed_globals.region)
endpoint = operation_object.service.get_endpoint(
region_name=parsed_globals.region,
endpoint_url=parsed_globals.endpoint_url)
endpoint.verify = not parsed_globals.no_verify_ssl
if operation_object.can_paginate and parsed_globals.paginate:
pages = operation_object.paginate(endpoint, **parameters)
Expand Down
6 changes: 6 additions & 0 deletions tests/unit/test_clidriver.py
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,12 @@ def test_aws_with_region(self):
host = self.last_request_headers()['Host']
self.assertEqual(host, 'ec2.us-west-2.amazonaws.com')

def test_aws_with_endpoint_url(self):
driver = create_clidriver()
driver.main('ec2 describe-instances --endpoint-url https://foobar.com/'.split())
host = self.last_request_headers()['Host']
self.assertEqual(host, 'foobar.com')

def inject_new_param(self, argument_table, **kwargs):
argument = BuiltInArgument('unknown-arg', {})
argument.add_to_arg_table(argument_table)
Expand Down

0 comments on commit d6c46df

Please sign in to comment.