The s3 endpoint in China is under a different DNS TLD: amazonaws.com.cn.

This commit is contained in:
James Brombegrer 2014-02-07 14:07:45 +00:00
parent 6168717ba9
commit 047920b120

View file

@ -58,6 +58,8 @@ class UploadImage(Task):
manifest_file = os.path.join(info.bundle_path, info.ami_name + '.manifest.xml') manifest_file = os.path.join(info.bundle_path, info.ami_name + '.manifest.xml')
if info.host['region'] == 'us-east-1': if info.host['region'] == 'us-east-1':
s3_url = 'https://s3.amazonaws.com/' s3_url = 'https://s3.amazonaws.com/'
elif info.host['region'] == 'cn-north-1':
s3_url = 'https://s3.cn-north-1.amazonaws.com.cn'
else: else:
s3_url = 'https://s3-{region}.amazonaws.com/'.format(region=info.host['region']) s3_url = 'https://s3-{region}.amazonaws.com/'.format(region=info.host['region'])
log_check_call(['/usr/bin/euca-upload-bundle', log_check_call(['/usr/bin/euca-upload-bundle',