From ed9103aad5652272ae8aba96c3d0d25e9fe5508c Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Wed, 6 Feb 2013 22:02:10 -0800 Subject: [PATCH] rgw: parse testdir into apache.conf 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 --- teuthology/task/apache.conf.template | 4 ++-- teuthology/task/rgw.py | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/teuthology/task/apache.conf.template b/teuthology/task/apache.conf.template index 3abf1d190b809..13b6ac9bd190a 100644 --- a/teuthology/task/apache.conf.template +++ b/teuthology/task/apache.conf.template @@ -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¶ms=$2&%{QUERY_STRING} [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L] +RewriteRule ^/([a-zA-Z0-9-_.]*)([/]?.*) /rgw.fcgi?page=$1¶ms=$2&%{{QUERY_STRING}} [E=HTTP_AUTHORIZATION:%{{HTTP:Authorization}},L] # Set fastcgi environment variables. # Note that this is separate from Unix environment variables! diff --git a/teuthology/task/rgw.py b/teuthology/task/rgw.py index ba92fcc30ee0f..482dffaeeb751 100644 --- a/teuthology/task/rgw.py +++ b/teuthology/task/rgw.py @@ -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, -- 2.39.5