From 3239da698ee7e5314eca7d73ce7c8e8a3380e89d Mon Sep 17 00:00:00 2001 From: Martin Magr Date: Thu, 13 Dec 2012 12:22:51 +0100 Subject: [PATCH] Added default MySQL password Fixes issue #22. --- packstack/plugins/mysql_001.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packstack/plugins/mysql_001.py b/packstack/plugins/mysql_001.py index 8acd4876e..1345b963d 100644 --- a/packstack/plugins/mysql_001.py +++ b/packstack/plugins/mysql_001.py @@ -2,6 +2,7 @@ Installs and configures MySQL """ +import uuid import logging import packstack.installer.engine_validators as validate @@ -52,8 +53,8 @@ def initConfig(controllerObject): "USAGE" : "Password for the MySQL admin user", "PROMPT" : "Password for the MySQL admin user", "OPTION_LIST" : [], - "VALIDATION_FUNC" : lambda a,b: True, - "DEFAULT_VALUE" : "", + "VALIDATION_FUNC" : validate.validateStringNotEmpty, + "DEFAULT_VALUE" : uuid.uuid4().hex[:6], "MASK_INPUT" : True, "LOOSE_VALIDATION": True, "CONF_NAME" : "CONFIG_MYSQL_PW", @@ -83,4 +84,3 @@ def createmanifest(): manifestfile = "%s_mysql.pp"%controller.CONF['CONFIG_MYSQL_HOST'] manifestdata = getManifestTemplate("mysql.pp") appendManifestFile(manifestfile, manifestdata, 'pre') -