Skip to content
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

Fix emr endpoints for eu-central-1 and cn-north-1 #423

Merged
merged 1 commit into from
Dec 30, 2014
Merged
Show file tree
Hide file tree
Changes from all 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 botocore/data/aws/_endpoints.json
Original file line number Diff line number Diff line change
Expand Up @@ -126,11 +126,17 @@
],
"elasticmapreduce":[
{
"uri":"https://cn-north-1.elasticmapreduce.amazonaws.com.cn",
"uri":"https://elasticmapreduce.cn-north-1.amazonaws.com.cn",
"constraints":[
["region", "startsWith", "cn-"]
]
},
{
"uri":"https://elasticmapreduce.eu-central-1.amazonaws.com",
"constraints":[
["region", "equals", "eu-central-1"]
]
},
{
"uri":"https://elasticmapreduce.us-east-1.amazonaws.com",
"constraints":[
Expand Down
20 changes: 20 additions & 0 deletions tests/integration/test_emr.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,30 @@
# language governing permissions and limitations under the License.
from tests import unittest

from nose.tools import assert_true

import botocore.session
from botocore.paginate import DeprecatedPageIterator


def test_emr_endpoints_work_with_py26():
# Verify that we can talk to all currently supported EMR endpoints.
# Python2.6 has an SSL cert bug where it can't read the SAN of
# certain SSL certs. We therefore need to always use the CN
# as the hostname.
session = botocore.session.get_session()
for region in ['us-east-1', 'us-west-2', 'us-west-2', 'ap-northeast-1',
'ap-southeast-1', 'ap-southeast-2', 'sa-east-1', 'eu-west-1',
'eu-central-1']:
yield _test_can_list_clusters_in_region, session, region


def _test_can_list_clusters_in_region(session, region):
client = session.create_client('emr', region_name=region)
response = client.list_clusters()
assert_true('Clusters' in response)


# I consider these integration tests because they're
# testing more than a single unit, we're ensuring everything
# accessible from the session works as expected.
Expand Down
5 changes: 4 additions & 1 deletion tests/unit/test_regions.py
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@
"monitoring": "monitoring.cn-north-1.amazonaws.com.cn",
"dynamodb": "dynamodb.cn-north-1.amazonaws.com.cn",
"ec2": "ec2.cn-north-1.amazonaws.com.cn",
"elasticmapreduce": "cn-north-1.elasticmapreduce.amazonaws.com.cn",
"elasticmapreduce": "elasticmapreduce.cn-north-1.amazonaws.com.cn",
"elasticache": "elasticache.cn-north-1.amazonaws.com.cn",
"rds": "rds.cn-north-1.amazonaws.com.cn",
"sns": "sns.cn-north-1.amazonaws.com.cn",
Expand Down Expand Up @@ -284,6 +284,9 @@
"fips-us-gov-west-1": {
"s3": "s3-fips-us-gov-west-1.amazonaws.com"
},
"eu-central-1": {
"elasticmapreduce": "elasticmapreduce.eu-central-1.amazonaws.com",
}
}

def test_known_endpoints():
Expand Down