Merge "Use publicURLs for generated endpoints for ec2rc.sh" into stable/essex

This commit is contained in:
Jenkins 2012-06-21 23:51:57 +00:00 committed by Gerrit Code Review
commit 63845ef258
2 changed files with 11 additions and 1 deletions

View File

@ -38,6 +38,7 @@ Mike Scherbakov <mihgen@gmail.com>
Monty Taylor <mordred@inaugust.com>
Neil Johnston <onewheeldrive.net@gmail.com>
Paul McMillan <paul.mcmillan@nebula.com>
Sam Morrison <sorrison@gmail.com>
Stephane Angot <sa@hydre.org>
termie <github@anarkystic.com>
Thierry Carrez <thierry@openstack.org>

View File

@ -80,7 +80,16 @@ class DownloadX509Credentials(forms.SelfHandlingForm):
keys = find_or_create_access_keys(request, data.get('tenant'))
context = {'ec2_access_key': keys.access,
'ec2_secret_key': keys.secret,
'ec2_endpoint': api.url_for(request, 'ec2')}
'ec2_endpoint': api.url_for(request,
'ec2',
endpoint_type='publicURL')}
try:
s3_endpoint = api.url_for(request,
's3',
endpoint_type='publicURL')
except exceptions.ServiceCatalogException:
s3_endpoint = None
context['s3_endpoint'] = s3_endpoint
except:
exceptions.handle(request,
_('Unable to fetch EC2 credentials.'),