Merge pull request #10031 from kaithar/feature/test-fixes

Feature/test fixes
This commit is contained in:
Thomas S Hatch 2014-01-31 09:38:38 -08:00
commit ce1f305745
4 changed files with 14 additions and 11 deletions

View File

@ -1137,7 +1137,7 @@ def apply_vm_profiles_config(providers, overrides, defaults=None):
vms = {}
for key, val in config.items():
if key in ('conf_file', 'include', 'default_include'):
if key in ('conf_file', 'include', 'default_include', 'user'):
continue
if not isinstance(val, dict):
raise salt.cloud.exceptions.SaltCloudConfigError(
@ -1294,7 +1294,7 @@ def apply_cloud_providers_config(overrides, defaults=None):
providers = {}
for key, val in config.items():
if key in ('conf_file', 'include', 'default_include'):
if key in ('conf_file', 'include', 'default_include', 'user'):
continue
if not isinstance(val, (list, tuple)):

View File

@ -682,10 +682,12 @@ class AdaptedConfigurationTestCaseMixIn(object):
# Running as root, the running user does not need to be updated
return integration_config_dir
for fname in os.listdir(integration_config_dir):
if fname.startswith(('.', '_')):
continue
self.get_config_file_path(fname)
for triplet in os.walk(integration_config_dir):
partial = triplet[0].replace(integration_config_dir, "")[1:]
for fname in triplet[2]:
if fname.startswith(('.', '_')):
continue
self.get_config_file_path(os.path.join(partial, fname))
return TMP_CONF_DIR
def get_config_file_path(self, filename):
@ -696,10 +698,11 @@ class AdaptedConfigurationTestCaseMixIn(object):
# Running as root, the running user does not need to be updated
return integration_config_file
if not os.path.isdir(TMP_CONF_DIR):
os.makedirs(TMP_CONF_DIR)
updated_config_path = os.path.join(TMP_CONF_DIR, filename)
partial = os.path.dirname(updated_config_path)
if not os.path.isdir(partial):
os.makedirs(partial)
if not os.path.isfile(updated_config_path):
self.__update_config(integration_config_file, updated_config_path)
return updated_config_path

View File

@ -8,7 +8,7 @@ import os
import shutil
import sys
from mock import patch, MagicMock
from salttesting.mock import patch, MagicMock
# Import Salt Testing libs
from salttesting import skipIf

View File

@ -3,7 +3,7 @@
# Import python libs
import logging
from mock import patch
from salttesting.mock import patch
# Import Salt Testing libs
from salttesting import skipIf