Cleaned packstack.installer.common_utils

- cleaned from useless functions
- refactored to be pep8 compliant
- separated to standalone modules
- added unit tests

Change-Id: If5a300fe04efab9e13549f2b4d05c1b28e2e40c6
This commit is contained in:
Martin Magr
2013-03-01 18:30:07 +01:00
parent 7ef0830ae7
commit eba1d3d5d2
31 changed files with 453 additions and 537 deletions

View File

@@ -8,7 +8,7 @@ import os
from packstack.installer import validators
from packstack.installer import basedefs
import packstack.installer.common_utils as utils
from packstack.installer import utils
from packstack.modules.ospluginutils import getManifestTemplate, appendManifestFile, manifestfiles
@@ -17,7 +17,7 @@ controller = None
# Plugin name
PLUGIN_NAME = "OS-SWIFT"
PLUGIN_NAME_COLORED = utils.getColoredText(PLUGIN_NAME, basedefs.BLUE)
PLUGIN_NAME_COLORED = utils.color_text(PLUGIN_NAME, 'blue')
logging.debug("plugin %s loaded", __name__)
@@ -31,7 +31,7 @@ def initConfig(controllerObject):
"PROMPT" : "Enter the IP address of the Swift proxy service",
"OPTION_LIST" : [],
"VALIDATORS" : [validators.validate_ip, validators.validate_ssh],
"DEFAULT_VALUE" : utils.getLocalhostIP(),
"DEFAULT_VALUE" : utils.get_localhost_ip(),
"MASK_INPUT" : False,
"LOOSE_VALIDATION": True,
"CONF_NAME" : "CONFIG_SWIFT_PROXY_HOSTS", #XXX: Shouldn't be here CONFIG_SWIFT_PROXY_HOST?
@@ -55,7 +55,7 @@ def initConfig(controllerObject):
"PROMPT" : "Enter the Swift Storage servers e.g. host/dev,host/dev",
"OPTION_LIST" : [],
"VALIDATORS" : [validators.validate_not_empty, validate_storage],
"DEFAULT_VALUE" : utils.getLocalhostIP(),
"DEFAULT_VALUE" : utils.get_localhost_ip(),
"MASK_INPUT" : False,
"LOOSE_VALIDATION": True,
"CONF_NAME" : "CONFIG_SWIFT_STORAGE_HOSTS",