From c1eed2487d995019603b40d8d0e9ea387a50b017 Mon Sep 17 00:00:00 2001
From: Vincent Pelletier <vincent@nexedi.com>
Date: Wed, 8 Feb 2012 15:52:52 +0100
Subject: [PATCH] Fetch config from self.config .

mysql_conf is only to be used to render a template.
---
 slapos/recipe/generic_mysql/__init__.py | 20 +++++++-------------
 1 file changed, 7 insertions(+), 13 deletions(-)

diff --git a/slapos/recipe/generic_mysql/__init__.py b/slapos/recipe/generic_mysql/__init__.py
index 3d42f6c2a..036687c56 100644
--- a/slapos/recipe/generic_mysql/__init__.py
+++ b/slapos/recipe/generic_mysql/__init__.py
@@ -49,12 +49,6 @@ class Recipe(GenericBaseRecipe):
         socket=self.options['socket'],
         error_log=self.options['error-log'],
         slow_query_log=self.options['slow-query-log'],
-        mysql_database=self.options['database'],
-        mysql_user=self.options['user'],
-        mysql_password=self.options['password'],
-        mysql_test_database=self.options['test-database'],
-        mysql_test_user=self.options['test-user'],
-        mysql_test_password=self.options['test-password'],
     )
 
     mysql_binary = self.options['mysql-binary']
@@ -78,18 +72,18 @@ class Recipe(GenericBaseRecipe):
     mysql_script_list.append(self.substituteTemplate(
       self.getTemplateFilename('initmysql.sql.in'),
       {
-        'mysql_database': mysql_conf['mysql_database'],
-        'mysql_user': mysql_conf['mysql_user'],
-        'mysql_password': mysql_conf['mysql_password']
+        'mysql_database': self.options['database'],
+        'mysql_user': self.options['user'],
+        'mysql_password': self.options['password']
       }
     ))
     # default test database
     mysql_script_list.append(self.substituteTemplate(
       self.getTemplateFilename('initmysql.sql.in'),
       {
-        'mysql_database': mysql_conf['mysql_test_database'],
-        'mysql_user': mysql_conf['mysql_test_user'],
-        'mysql_password': mysql_conf['mysql_test_password']
+        'mysql_database': self.options['test-database'],
+        'mysql_user': self.options['test-user'],
+        'mysql_password': self.options['test-password']
       }
     ))
     # parallel test databases
@@ -125,7 +119,7 @@ class Recipe(GenericBaseRecipe):
       [dict(
         mysql_install_binary=self.options['mysql-install-binary'],
         mysqld_binary=mysqld_binary,
-        data_directory=mysql_conf['data_directory'],
+        data_directory=self.options['data-directory'],
         mysql_binary=mysql_binary,
         socket=socket,
         configuration_file=mysql_conf_file,
-- 
2.30.9