[CORD-3022] Splitting config
Change-Id: I841d7173729a1c3eb98c098e0b3b6a90de18dcba
diff --git a/xos/synchronizer/vrouter_config.yaml b/xos/synchronizer/config.yaml
similarity index 82%
rename from xos/synchronizer/vrouter_config.yaml
rename to xos/synchronizer/config.yaml
index 274ba24..df56433 100644
--- a/xos/synchronizer/vrouter_config.yaml
+++ b/xos/synchronizer/config.yaml
@@ -15,13 +15,21 @@
name: vrouter
-accessor:
- username: xosadmin@opencord.org
- password: "@/opt/xos/services/vrouter/credentials/xosadmin@opencord.org"
required_models:
- VRouterService
- VRouterServiceInstance
+ - VRouterStaticRoute
dependency_graph: "/opt/xos/synchronizers/vrouter/model-deps"
steps_dir: "/opt/xos/synchronizers/vrouter/steps"
sys_dir: "/opt/xos/synchronizers/vrouter/sys"
models_dir: "/opt/xos/synchronizers/vrouter/models"
+logging:
+ version: 1
+ handlers:
+ console:
+ class: logging.StreamHandler
+ loggers:
+ 'multistructlog':
+ handlers:
+ - console
+ level: DEBUG
diff --git a/xos/synchronizer/vrouter-synchronizer.py b/xos/synchronizer/vrouter-synchronizer.py
index 2850bd2..6eda455 100644
--- a/xos/synchronizer/vrouter-synchronizer.py
+++ b/xos/synchronizer/vrouter-synchronizer.py
@@ -21,9 +21,13 @@
import sys
from xosconfig import Config
-config_file = os.path.abspath(os.path.dirname(os.path.realpath(__file__)) + '/vrouter_config.yaml')
+base_config_file = os.path.abspath(os.path.dirname(os.path.realpath(__file__)) + '/config.yaml')
+mounted_config_file = os.path.abspath(os.path.dirname(os.path.realpath(__file__)) + '/mounted_config.yaml')
-Config.init(config_file, 'synchronizer-config-schema.yaml')
+if os.path.isfile(mounted_config_file):
+ Config.init(base_config_file, 'synchronizer-config-schema.yaml', mounted_config_file)
+else:
+ Config.init(base_config_file, 'synchronizer-config-schema.yaml')
synchronizer_path = os.path.join(os.path.dirname(os.path.realpath(__file__)), "../../synchronizers/new_base")
sys.path.append(synchronizer_path)