]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: parse testdir into apache.conf
authorSage Weil <sage@inktank.com>
Thu, 7 Feb 2013 06:02:10 +0000 (22:02 -0800)
committerSage Weil <sage@inktank.com>
Thu, 7 Feb 2013 06:02:10 +0000 (22:02 -0800)
Also fix up the template to use {{field}} for stuff we don't want to parse.
There is probably a better way...

Signed-off-by: Sage Weil <sage@inktank.com>
teuthology/task/apache.conf.template
teuthology/task/rgw.py

index 3abf1d190b8092878d4ebe207e93018dca25205a..13b6ac9bd190a9a57edb779b74b28c5885886dde 100644 (file)
@@ -7,7 +7,7 @@ ServerName rgwtest.example.com
 
 ServerRoot {testdir}/apache
 ErrorLog {testdir}/archive/apache/error.log
-LogFormat "%h l %u %t \"%r\" %>s %b \"{Referer}i\" \"%{User-agent}i\"" combined
+LogFormat "%h l %u %t \"%r\" %>s %b \"{{Referer}}i\" \"%{{User-agent}}i\"" combined
 CustomLog {testdir}/archive/apache/access.log combined
 PidFile {testdir}/apache/tmp/apache.pid
 DocumentRoot {testdir}/apache/htdocs
@@ -15,7 +15,7 @@ FastCgiIPCDir {testdir}/apache/tmp/fastcgi_sock
 FastCgiExternalServer {testdir}/apache/htdocs/rgw.fcgi -socket rgw_sock
 RewriteEngine On
 
-RewriteRule ^/([a-zA-Z0-9-_.]*)([/]?.*) /rgw.fcgi?page=$1&params=$2&%{QUERY_STRING} [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L]
+RewriteRule ^/([a-zA-Z0-9-_.]*)([/]?.*) /rgw.fcgi?page=$1&params=$2&%{{QUERY_STRING}} [E=HTTP_AUTHORIZATION:%{{HTTP:Authorization}},L]
 
 # Set fastcgi environment variables.
 # Note that this is separate from Unix environment variables!
index ba92fcc30ee0f96433486eadfa6b444e0a26f44e..482dffaeeb751cc00aa279cca96856bb9ad24f41 100644 (file)
@@ -57,10 +57,11 @@ def ship_config(ctx, config):
     for client in config.iterkeys():
         (remote,) = ctx.cluster.only(client).remotes.keys()
         with file(src, 'rb') as f:
+            conf = f.read().format(testdir=testdir)
             teuthology.write_file(
                 remote=remote,
                 path='{tdir}/apache/apache.conf'.format(tdir=testdir),
-                data=f,
+                data=conf,
                 )
         teuthology.write_file(
             remote=remote,