Browse code

Use apache2ctl after apache is installed.

Ensure that apache2ctl is only called if apache2 is being used when
setting up Keystone. This patch corrects a case where apache2ctl
is being called at the time lib/keystone is being sourced. This
error breaks attempts to deploy Keystone under apache unless
apache is already installed at the time stack.sh is run.

Change-Id: I02d426438fa1246effd68c6bb3c3358910ed4c05

Morgan Fainberg authored on 2014/06/10 04:07:29
Showing 1 changed files
... ...
@@ -87,10 +87,6 @@ if is_ssl_enabled_service "key"; then
87 87
     KEYSTONE_SERVICE_PROTOCOL="https"
88 88
 fi
89 89
 
90
-# Apache configuration file for keystone
91
-KEYSTONE_APACHE_CONF_FILE=$(apache_site_config_for keystone)
92
-
93
-
94 90
 # Functions
95 91
 # ---------
96 92
 # cleanup_keystone() - Remove residual data files, anything left over from previous
... ...
@@ -106,18 +102,20 @@ function cleanup_keystone {
106 106
 function _cleanup_keystone_apache_wsgi {
107 107
     sudo rm -f $KEYSTONE_WSGI_DIR/*.wsgi
108 108
     disable_apache_site keystone
109
-    sudo rm -f $KEYSTONE_APACHE_CONF_FILE
109
+    sudo rm -f $(apache_site_config_for keystone)
110 110
 }
111 111
 
112 112
 # _config_keystone_apache_wsgi() - Set WSGI config files of Keystone
113 113
 function _config_keystone_apache_wsgi {
114 114
     sudo mkdir -p $KEYSTONE_WSGI_DIR
115 115
 
116
+    local keystone_apache_conf=$(apache_site_config_for keystone)
117
+
116 118
     # copy proxy vhost and wsgi file
117 119
     sudo cp $KEYSTONE_DIR/httpd/keystone.py $KEYSTONE_WSGI_DIR/main
118 120
     sudo cp $KEYSTONE_DIR/httpd/keystone.py $KEYSTONE_WSGI_DIR/admin
119 121
 
120
-    sudo cp $FILES/apache-keystone.template $KEYSTONE_APACHE_CONF_FILE
122
+    sudo cp $FILES/apache-keystone.template $keystone_apache_conf
121 123
     sudo sed -e "
122 124
         s|%PUBLICPORT%|$KEYSTONE_SERVICE_PORT|g;
123 125
         s|%ADMINPORT%|$KEYSTONE_AUTH_PORT|g;
... ...
@@ -125,7 +123,7 @@ function _config_keystone_apache_wsgi {
125 125
         s|%PUBLICWSGI%|$KEYSTONE_WSGI_DIR/main|g;
126 126
         s|%ADMINWSGI%|$KEYSTONE_WSGI_DIR/admin|g;
127 127
         s|%USER%|$STACK_USER|g
128
-    " -i $KEYSTONE_APACHE_CONF_FILE
128
+    " -i $keystone_apache_conf
129 129
     enable_apache_site keystone
130 130
 }
131 131