[CORD-3022] Splitting config
Change-Id: Ifae06bbfe45f4dad49fdca644b9dd579c048656a
diff --git a/xos/synchronizer/onos_config.yaml b/xos/synchronizer/config.yaml
similarity index 78%
rename from xos/synchronizer/onos_config.yaml
rename to xos/synchronizer/config.yaml
index aa84d2c..c7581d1 100644
--- a/xos/synchronizer/onos_config.yaml
+++ b/xos/synchronizer/config.yaml
@@ -15,10 +15,20 @@
name: onos
-accessor:
- username: xosadmin@opencord.org
- password: "@/opt/xos/services/onos/credentials/xosadmin@opencord.org"
+required_models:
+ - ONOSService
+ - ONOSApp
dependency_graph: "/opt/xos/synchronizers/onos/model-deps"
steps_dir: "/opt/xos/synchronizers/onos/steps"
sys_dir: "/opt/xos/synchronizers/onos/sys"
models_dir: "/opt/xos/synchronizers/onos/models"
+logging:
+ version: 1
+ handlers:
+ console:
+ class: logging.StreamHandler
+ loggers:
+ 'multistructlog':
+ handlers:
+ - console
+ level: DEBUG
diff --git a/xos/synchronizer/onos-synchronizer.py b/xos/synchronizer/onos-synchronizer.py
index 5e04fda..337472d 100755
--- a/xos/synchronizer/onos-synchronizer.py
+++ b/xos/synchronizer/onos-synchronizer.py
@@ -21,8 +21,13 @@
import sys
from xosconfig import Config
-config_file = os.path.abspath(os.path.dirname(os.path.realpath(__file__)) + '/onos_config.yaml')
-Config.init(config_file, 'synchronizer-config-schema.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')
+
+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')
observer_path = os.path.join(os.path.dirname(os.path.realpath(__file__)),"../../synchronizers/new_base")
sys.path.append(observer_path)