Merge "Change message in certain cases"

This commit is contained in:
Jenkins
2013-10-04 01:15:10 +00:00
committed by Gerrit Code Review
10 changed files with 213 additions and 139 deletions

View File

@@ -20,7 +20,7 @@ import shutil
import sys
from unittest import TestCase
from packstack.modules import ospluginutils
from packstack.modules import ospluginutils, puppet
from packstack.installer import run_setup, basedefs
from ..test_base import PackstackTestCaseMixin
@@ -55,9 +55,9 @@ class CommandLineTestCase(PackstackTestCaseMixin, TestCase):
# There is no puppet logfile to validate, so replace
# ospluginutils.validate_puppet_logfile with a mock function
orig_validate_logfile = ospluginutils.validate_puppet_logfile
ospluginutils.validate_puppet_logfile = lambda a: None
ospluginutils.scan_puppet_logfile = lambda a: []
orig_validate_logfile = puppet.validate_logfile
puppet.validate_logfile = lambda a: None
puppet.scan_logfile = lambda a: []
# If there is a error in a plugin sys.exit() gets called, this masks
# the actual error that should be reported, so we replace it to

View File

@@ -105,3 +105,11 @@ class ParameterTestCase(PackstackTestCaseMixin, TestCase):
mask_list=["'text'"],
replace_list=[("'", "'\\''")])
self.assertEqual(masked, 'test %s' % STR_MASK)
def test_shortcuts(self):
"""Test packstack.installer.utils.shortcuts functions"""
conf = {"A_HOST": "1.1.1.1", "B_HOSTS": "2.2.2.2,1.1.1.1",
"C_HOSTS": "3.3.3.3/vdc"}
hostlist = list(hosts(conf))
hostlist.sort()
self.assertEquals(['1.1.1.1', '2.2.2.2', '3.3.3.3'], hostlist)