Merge "Added ability for running tests."

This commit is contained in:
Jenkins 2016-05-17 14:42:29 +00:00 committed by Gerrit Code Review
commit 6cba880c9e
3 changed files with 11 additions and 6 deletions

View File

@ -15,24 +15,29 @@
# under the License.
import os
import sys
import yaml
from fuel_bootstrap import consts
from fuel_bootstrap import errors
class Configuration(object):
def __init__(self, config_file=None):
data = {}
if not config_file:
config_file = consts.CONFIG_FILE
if os.path.exists(config_file):
with open(config_file) as f:
data = yaml.load(f)
else:
raise errors.ConfigFileNotExists(
"Default config couldn't be found in {0}"
.format(config_file))
# TODO(atolochkova): need to add logger
sys.stderr.write("Default config couldn't be found in {0}"
.format(config_file))
self._data = data
def __getattr__(self, name):
return self._data.get(name)
CONF = Configuration()

View File

@ -32,7 +32,7 @@ from fuel_bootstrap import settings
from fuel_bootstrap.utils import data as data_util
from fuel_bootstrap.utils import notifier
CONF = settings.Configuration()
CONF = settings.CONF
LOG = logging.getLogger(__name__)
ACTIVE = 'active'

View File

@ -24,7 +24,7 @@ from fuel_bootstrap import consts
from fuel_bootstrap import errors
from fuel_bootstrap import settings
CONF = settings.Configuration()
CONF = settings.CONF
class BootstrapDataBuilder(object):