From 48b1e51430ec2eab4c33933fa1ececf65ae04816 Mon Sep 17 00:00:00 2001 From: Yuriy Taraday Date: Wed, 26 Oct 2016 09:28:49 +0200 Subject: [PATCH] Add 'url' section to config, pass it down to Dockerfile.j2 Change-Id: Ib43889dcec99c515b9932de381cf3ef25fbc7ff9 --- fuel_ccp/build.py | 1 + fuel_ccp/config/__init__.py | 6 ++++-- fuel_ccp/config/url.py | 12 ++++++++++++ 3 files changed, 17 insertions(+), 2 deletions(-) create mode 100644 fuel_ccp/config/url.py diff --git a/fuel_ccp/build.py b/fuel_ccp/build.py index 2659c18e..8e793fc2 100644 --- a/fuel_ccp/build.py +++ b/fuel_ccp/build.py @@ -341,6 +341,7 @@ def _get_config(): CONF.registry.address, cfg['render']['namespace']) cfg['render'].update(CONF.versions._items()) + cfg['render']['url'] = CONF.url cfg['sources'] = CONF.sources return cfg diff --git a/fuel_ccp/config/__init__.py b/fuel_ccp/config/__init__.py index 9c2e4f27..b5ac1752 100644 --- a/fuel_ccp/config/__init__.py +++ b/fuel_ccp/config/__init__.py @@ -12,6 +12,7 @@ from fuel_ccp.config import registry from fuel_ccp.config import replicas from fuel_ccp.config import repositories from fuel_ccp.config import sources +from fuel_ccp.config import url LOG = logging.getLogger(__name__) @@ -54,7 +55,7 @@ CONF = _Wrapper() CONFIG_MODULES = [ builder, cli, images, kubernetes, registry, replicas, repositories, - sources, + sources, url, ] @@ -103,7 +104,8 @@ def validate_config(yconf=None): def load_component_defaults(): from fuel_ccp.common import utils - sections = ['versions', 'sources', 'configs', 'nodes', 'roles', 'replicas'] + sections = ['versions', 'sources', 'configs', 'nodes', 'roles', 'replicas', + 'url'] new_config = _yaml.AttrDict((k, _yaml.AttrDict()) for k in sections) for path in utils.get_config_paths(): if not os.path.exists(path): diff --git a/fuel_ccp/config/url.py b/fuel_ccp/config/url.py new file mode 100644 index 00000000..11ae3171 --- /dev/null +++ b/fuel_ccp/config/url.py @@ -0,0 +1,12 @@ +SCHEMA = { + 'url': { + 'type': 'object', + 'additionalProperties': { + 'type': 'string', + }, + } +} + +DEFAULTS = { + 'url': {}, +}