From 085855479f5a56e9ce21fdb83e2691c8aad56aa0 Mon Sep 17 00:00:00 2001 From: Marian Horban Date: Mon, 12 Oct 2015 11:36:51 -0400 Subject: [PATCH] Added processing /ec2 URL With config option NOVA_USE_MOD_WSGI=True nova-ec2-api handles requests on /ec2 URL. Change-Id: I0c2e99bf8b5e5cf53cd176685b206038a4b0f78b --- files/apache-nova-ec2-api.template | 9 +++++++++ lib/nova | 13 +++++++++---- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/files/apache-nova-ec2-api.template b/files/apache-nova-ec2-api.template index 235d958d1a..6443567740 100644 --- a/files/apache-nova-ec2-api.template +++ b/files/apache-nova-ec2-api.template @@ -14,3 +14,12 @@ Listen %PUBLICPORT% %SSLCERTFILE% %SSLKEYFILE% + +Alias /ec2 %PUBLICWSGI% + + SetHandler wsgi-script + Options +ExecCGI + WSGIProcessGroup nova-ec2-api + WSGIApplicationGroup %{GLOBAL} + WSGIPassAuthorization On + diff --git a/lib/nova b/lib/nova index 9830276232..eb1ae1cfaa 100644 --- a/lib/nova +++ b/lib/nova @@ -440,13 +440,18 @@ function create_nova_accounts { # EC2 if [[ "$KEYSTONE_CATALOG_BACKEND" = "sql" ]]; then - + local nova_ec2_api_url + if [[ "$NOVA_USE_MOD_WSGI" == "False" ]]; then + nova_ec2_api_url="$EC2_SERVICE_PROTOCOL://$SERVICE_HOST:$EC2_SERVICE_PORT/" + else + nova_ec2_api_url="$EC2_SERVICE_PROTOCOL://$SERVICE_HOST/ec2" + fi get_or_create_service "ec2" "ec2" "EC2 Compatibility Layer" get_or_create_endpoint "ec2" \ "$REGION_NAME" \ - "$EC2_SERVICE_PROTOCOL://$SERVICE_HOST:8773/" \ - "$EC2_SERVICE_PROTOCOL://$SERVICE_HOST:8773/" \ - "$EC2_SERVICE_PROTOCOL://$SERVICE_HOST:8773/" + "$nova_ec2_api_url" \ + "$nova_ec2_api_url" \ + "$nova_ec2_api_url" fi fi