Use publicURLs for generated endpoints for ec2rc.sh

Fixes bug 994297

Change-Id: Icbc0b3ca327d87754bac291b0d179faacdabc7aa
This commit is contained in:
Sam Morrison 2012-05-04 09:12:47 +10:00 committed by Mark McLoughlin
parent 8f1ea73606
commit 83647436f7
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.'),