From 7e480c6c1800ac5fa323eba525d29ac50477ae88 Mon Sep 17 00:00:00 2001
From: Jeremy Stanley <fungi@yuggoth.org>
Date: Mon, 29 Jul 2013 16:05:59 +0000
Subject: [PATCH] Additional path patterns for log readme files.

* modules/openstack_project/templates/logs-dev.vhost.erb
* modules/openstack_project/templates/logs.vhost.erb: With the
recent advent of an additional parent node in the job log path, the
ReadmeName was no longer being applied to new log directories. This
corrects it by adding duplicate Directory blocks for them with the
new pattern. Note that ReadmeName does not work inside regular
expression blocks like DirectoryMatch, but the old Directory blocks
can be removed when those logs expire in about 6 months time. Also
added patterns to provide readme files for equivalent periodic jobs.

Change-Id: Ib12f1d6f033b8129af38d694f7b221bea9614ecd
---
 .../templates/logs-dev.vhost.erb              | 21 +++++++++++++++++++
 .../templates/logs.vhost.erb                  | 21 +++++++++++++++++++
 2 files changed, 42 insertions(+)

diff --git a/modules/openstack_project/templates/logs-dev.vhost.erb b/modules/openstack_project/templates/logs-dev.vhost.erb
index 108962a034..727f76e3c8 100644
--- a/modules/openstack_project/templates/logs-dev.vhost.erb
+++ b/modules/openstack_project/templates/logs-dev.vhost.erb
@@ -29,12 +29,33 @@ NameVirtualHost <%= vhost_name %>:<%= port %>
     Order allow,deny
     allow from all
   </Directory>
+
+  <Directory <%= docroot %>/*/*/*/*/gate-tempest-devstack*/*>
+     ReadmeName /help/tempest-overview.html
+  </Directory>
+  <Directory <%= docroot %>/periodic/*/periodic-tempest-devstack*/*>
+     ReadmeName /help/tempest-overview.html
+  </Directory>
+  <Directory <%= docroot %>/*/*/*/*/gate-tempest-devstack*/*/logs/>
+     ReadmeName /help/tempest-logs.html
+  </Directory>
+  <Directory <%= docroot %>/periodic/*/periodic-tempest-devstack*/*/logs/>
+     ReadmeName /help/tempest-logs.html
+  </Directory>
+
+  # old patterns, can be removed in February 2014
   <Directory <%= docroot %>/*/*/*/gate-tempest-devstack*/*>
      ReadmeName /help/tempest-overview.html
   </Directory>
+  <Directory <%= docroot %>/periodic/periodic-tempest-devstack*/*>
+     ReadmeName /help/tempest-overview.html
+  </Directory>
   <Directory <%= docroot %>/*/*/*/gate-tempest-devstack*/*/logs/>
      ReadmeName /help/tempest-logs.html
   </Directory>
+  <Directory <%= docroot %>/periodic/periodic-tempest-devstack*/*/logs/>
+     ReadmeName /help/tempest-logs.html
+  </Directory>
 
   RewriteEngine On
   # rewrite all txt.gz files to map to our internal htmlify wsgi app
diff --git a/modules/openstack_project/templates/logs.vhost.erb b/modules/openstack_project/templates/logs.vhost.erb
index d45669b7d6..504144a07f 100644
--- a/modules/openstack_project/templates/logs.vhost.erb
+++ b/modules/openstack_project/templates/logs.vhost.erb
@@ -27,12 +27,33 @@ NameVirtualHost <%= vhost_name %>:<%= port %>
     Order allow,deny
     allow from all
   </Directory>
+
+  <Directory <%= docroot %>/*/*/*/*/gate-tempest-devstack*/*>
+     ReadmeName /help/tempest-overview.html
+  </Directory>
+  <Directory <%= docroot %>/periodic/*/periodic-tempest-devstack*/*>
+     ReadmeName /help/tempest-overview.html
+  </Directory>
+  <Directory <%= docroot %>/*/*/*/*/gate-tempest-devstack*/*/logs/>
+     ReadmeName /help/tempest-logs.html
+  </Directory>
+  <Directory <%= docroot %>/periodic/*/periodic-tempest-devstack*/*/logs/>
+     ReadmeName /help/tempest-logs.html
+  </Directory>
+
+  # old patterns, can be removed in February 2014
   <Directory <%= docroot %>/*/*/*/gate-tempest-devstack*/*>
      ReadmeName /help/tempest-overview.html
   </Directory>
+  <Directory <%= docroot %>/periodic/periodic-tempest-devstack*/*>
+     ReadmeName /help/tempest-overview.html
+  </Directory>
   <Directory <%= docroot %>/*/*/*/gate-tempest-devstack*/*/logs/>
      ReadmeName /help/tempest-logs.html
   </Directory>
+  <Directory <%= docroot %>/periodic/periodic-tempest-devstack*/*/logs/>
+     ReadmeName /help/tempest-logs.html
+  </Directory>
 
   ErrorLog /var/log/apache2/<%= name %>_error.log
   LogLevel warn