From c0cf313e90bf6cae4aab8fa3d6719fb514a59dd4 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?C=C3=A9dric=20Le=20Ninivin?= <cedric.leninivin@tiolive.com>
Date: Wed, 22 May 2013 18:26:29 +0200
Subject: [PATCH] apache-frontend: Use domain instead of server_name

---
 software/apache-frontend/apache-slave-list.cfg.in | 4 ++--
 software/apache-frontend/apache-yakari.cfg.in     | 6 +++---
 software/apache-frontend/apache.conf.in           | 2 +-
 software/apache-frontend/apache_cached.conf.in    | 2 +-
 software/apache-frontend/instance.cfg             | 4 ++--
 5 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/software/apache-frontend/apache-slave-list.cfg.in b/software/apache-frontend/apache-slave-list.cfg.in
index 79538680b..bfd462290 100644
--- a/software/apache-frontend/apache-slave-list.cfg.in
+++ b/software/apache-frontend/apache-slave-list.cfg.in
@@ -56,8 +56,8 @@ apache_custom_https = {{ dumps(apache_custom_https) }}
 {{ '\n' }}
 
 # The slave use cache
-{%   if 'enable_cache' in slave_instance and 'url' in slave_instance and 'server_name' in slave_instance -%}
-{%     do cached_server_dict.__setitem__(slave_instance.get('server_name'), slave_instance.get('url')) -%}
+{%   if 'enable_cache' in slave_instance and 'url' in slave_instance and 'domain' in slave_instance -%}
+{%     do cached_server_dict.__setitem__(slave_instance.get('domain'), slave_instance.get('url')) -%}
 {%   endif -%}
 
 {% endfor -%}
diff --git a/software/apache-frontend/apache-yakari.cfg.in b/software/apache-frontend/apache-yakari.cfg.in
index da6bb0761..62c344046 100644
--- a/software/apache-frontend/apache-yakari.cfg.in
+++ b/software/apache-frontend/apache-yakari.cfg.in
@@ -14,12 +14,12 @@ context =
 {%   set slave_reference = slave_instance.get('slave_reference') -%}
 {%   set slave_section_title = 'dynamic-template-slave-instance-%s' % slave_reference -%}
 {%   set slave_parameter_dict = generic_instance_parameter_dict.copy() -%}
-{%   if slave_instance.get('server_name', None) == None -%}
-{%     do slave_instance.__setitem__('server_name', "%s.%s" % (slave_instance.get('slave_reference').replace("-", "").lower(), domain)) -%}
+{%   if slave_instance.get('domain', None) == None -%}
+{%     do slave_instance.__setitem__('domain', "%s.%s" % (slave_instance.get('slave_reference').replace("-", "").lower(), domain)) -%}
 {%   endif -%}
 {%   if 'enable_cache' in slave_instance -%}
 # The slave use cache
-{%     do cached_server_dict.__setitem__(slave_instance.get('server_name'), slave_instance.get('url')) -%}
+{%     do cached_server_dict.__setitem__(slave_instance.get('domain'), slave_instance.get('url')) -%}
 {%   endif -%}
 {%     do slave_instance.__setitem__('url', cache_access) -%}
 {%   do part_list.append(slave_section_title) -%}
diff --git a/software/apache-frontend/apache.conf.in b/software/apache-frontend/apache.conf.in
index 15d6f279a..53020cc09 100644
--- a/software/apache-frontend/apache.conf.in
+++ b/software/apache-frontend/apache.conf.in
@@ -3,7 +3,7 @@
 
 # Basic server configuration
 PidFile "{{ pid_file }}"
-ServerName {{ server_name }}
+ServerName {{ domain }}
 DocumentRoot {{ document_root }}
 ServerRoot {{ instance_home }}
 
diff --git a/software/apache-frontend/apache_cached.conf.in b/software/apache-frontend/apache_cached.conf.in
index 8ea078165..101c64f67 100644
--- a/software/apache-frontend/apache_cached.conf.in
+++ b/software/apache-frontend/apache_cached.conf.in
@@ -3,7 +3,7 @@
 
 # Basic server configuration
 PidFile "{{ pid_file }}"
-ServerName {{ server_name }}
+ServerName {{ domain }}
 DocumentRoot {{ document_root }}
 ServerRoot {{ instance_home }}
 
diff --git a/software/apache-frontend/instance.cfg b/software/apache-frontend/instance.cfg
index 9e759a552..d178e19f9 100644
--- a/software/apache-frontend/instance.cfg
+++ b/software/apache-frontend/instance.cfg
@@ -155,7 +155,7 @@ rendered = $${apache-configuration:frontend-configuration}
 extra-context =
     raw httpd_home ${apache-2.2:location}
     key httpd_mod_ssl_cache_directory apache-directory:mod-ssl
-    key server_name instance-parameter:configuration.domain
+    key domain instance-parameter:configuration.domain
     key document_root apache-directory:document-root
     key instance_home buildout:directory
     key ipv4_addr instance-parameter:ipv4-random
@@ -190,7 +190,7 @@ rendered = $${apache-configuration:cached-configuration}
 extra-context =
     raw httpd_home ${apache-2.2:location}
     key httpd_mod_ssl_cache_directory apache-directory:mod-ssl
-    key server_name instance-parameter:configuration.domain
+    key domain instance-parameter:configuration.domain
     key document_root apache-directory:document-root
     key instance_home buildout:directory
     key ipv4_addr instance-parameter:ipv4-random
-- 
2.30.9