From 83647436f7cb0ab1fae1ff0054b0f7d5231725a5 Mon Sep 17 00:00:00 2001 From: Sam Morrison Date: Fri, 4 May 2012 09:12:47 +1000 Subject: [PATCH] Use publicURLs for generated endpoints for ec2rc.sh Fixes bug 994297 Change-Id: Icbc0b3ca327d87754bac291b0d179faacdabc7aa --- AUTHORS | 1 + horizon/dashboards/settings/ec2/forms.py | 11 ++++++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/AUTHORS b/AUTHORS index 1299a80ac2..22400c1932 100644 --- a/AUTHORS +++ b/AUTHORS @@ -38,6 +38,7 @@ Mike Scherbakov Monty Taylor Neil Johnston Paul McMillan +Sam Morrison Stephane Angot termie Thierry Carrez diff --git a/horizon/dashboards/settings/ec2/forms.py b/horizon/dashboards/settings/ec2/forms.py index 4c643d2a73..1105aa6241 100644 --- a/horizon/dashboards/settings/ec2/forms.py +++ b/horizon/dashboards/settings/ec2/forms.py @@ -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.'),