mirror of
https://github.com/valitydev/salt.git
synced 2024-11-07 00:55:19 +00:00
Merge pull request #10031 from kaithar/feature/test-fixes
Feature/test fixes
This commit is contained in:
commit
ce1f305745
@ -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)):
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user