Merge "Added ability for running tests."
This commit is contained in:
commit
6cba880c9e
|
@ -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()
|
||||
|
|
|
@ -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'
|
||||
|
||||
|
|
|
@ -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):
|
||||
|
|
Loading…
Reference in New Issue