Use checkMySQLConfiguration function to check root password
authorAlberto Di Meglio <alberto.di.meglio@cern.ch>
Tue, 11 Oct 2005 22:15:36 +0000 (22:15 +0000)
committerAlberto Di Meglio <alberto.di.meglio@cern.ch>
Tue, 11 Oct 2005 22:15:36 +0000 (22:15 +0000)
org.glite.deployment.lb/CHANGELOG
org.glite.deployment.lb/config/scripts/glite-lb-config.py
org.glite.deployment.lb/config/templates/glite-lb.cfg.xml
org.glite.deployment.lb/project/version.properties

index 32a02b4..8282547 100644 (file)
@@ -1,3 +1,6 @@
+DATE: 12-10-2005 00:15\r
+[dimeglio] Use checkMySQLConfiguration function to check root password\r
+\r
 DATE: 13-09-2005 23:00\r
 [dimeglio] Use standard mysql module functions to create db\r
 \r
index 699a4d8..ff6ab42 100644 (file)
@@ -6,7 +6,7 @@
 # For license conditions see the license file or http://eu-egee.org/license.html
 #
 ################################################################################
-# glite-lb-config v. 2.0.3
+# glite-lb-config v. 2.0.4
 #
 # Post-installation script for configuring the gLite Logging and Bookkeping Server
 # Robert Harakaly < robert.harakaly@cern.ch >
@@ -46,7 +46,7 @@ class glite_lb:
     def __init__(self):
         self.mysql = MySQL.Mysql()
         self.verbose = 0
-        self.version = "2.0.3"
+        self.version = "2.0.4"
         self.name = "glite-lb"
         self.friendly_name = "gLite Logging and Bookkeeping"
         params['module.version'] = self.version
@@ -264,11 +264,17 @@ python %s-config [OPTION...]""" % (self.name, os.environ['GLITE_LOCATION'], \
         if not os.path.exists('/tmp/mysql.sock'):
             os.symlink('/var/lib/mysql/mysql.sock', '/tmp/mysql.sock')
 
-        # Set root password
-        mysql_root_password = params['mysql.root.password']
-        if mysql_root_password != "":
-            self.mysql.setpassword(mysql_root_password)
-
+        # ------------------------------------------------------------
+        # Check password of MySQL
+        # ------------------------------------------------------------
+        
+        self.mysql_root_password = params['mysql.root.password']
+        if not params.has_key('set.mysql.root.password'):
+            params['set.mysql.root.password'] = 'false'
+        setempty = params['set.mysql.root.password']
+        if self.mysql.checkMySQLConfiguration(self.mysql_root_password,setempty):
+            return 1
+        
         # Create the MySQL database
         print "\nCreate/Verify the %s database" % params['lb.database.name']
         
index 72ada69..97995a8 100644 (file)
                        description="Enable check of host certificates"
                        value="true"/>
 
+               <!-- mysql configuration -->
+               <set.mysql.root.password
+                       description="If this parameter is true, then the root password of the mysql database
+                       is set to the value specified in mysql.root.password if it not yet set. This parameter has
+                       no effect if the database root password is already set. It can be used to ease automated
+                       installation and configuration of the service, if mysql is not managed in some other way"
+                       value="false"/>
+
                <!-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx -->
                <!-- System parameters - You should leave these alone -->
                <!-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx -->               
index a8dd386..6658ae7 100644 (file)
@@ -1,4 +1,4 @@
 
-module.version = 2.0.3
+module.version = 2.0.4
 module.age = 1
                                
\ No newline at end of file