Allow specifying of a global --password option

This fixes bz#1108742 by providing a new global parameter
"--default-password", that will be the default for all other password
parameters if set. Each individual password parameter can override the
default global, and if none are set, a random password will be used as
before.

As part of the change, process_param_value() has been updated, to avoid
leaking passwords when they are modified by a processor function.

Change-Id: Ic5947567599c8b221b7a9e60acb4708429507741
This commit is contained in:
Javier Pena
2014-09-17 16:15:03 +02:00
parent a45eaf6128
commit 512bdce979
18 changed files with 181 additions and 62 deletions

View File

@@ -8,6 +8,7 @@ import uuid
import logging
from packstack.installer import validators
from packstack.installer import processors
from packstack.installer import utils
from packstack.installer.utils import split_hosts
from packstack.modules.common import filtered_hosts
@@ -59,7 +60,8 @@ def initConfig(controller):
"PROMPT": "Enter the password for the MariaDB admin user",
"OPTION_LIST": [],
"VALIDATORS": [validators.validate_not_empty],
"DEFAULT_VALUE": uuid.uuid4().hex[:16],
"PROCESSORS": [processors.process_password],
"DEFAULT_VALUE": "PW_PLACEHOLDER",
"MASK_INPUT": True,
"LOOSE_VALIDATION": True,
"CONF_NAME": "CONFIG_MARIADB_PW",