SEBA-405 Update SimpleExampleService to use synchronizer library
Change-Id: Ibe0d8cd56325cdc2f6f7a4752c4012fad4162121
diff --git a/xos/synchronizer/simpleexampleservice-synchronizer.py b/xos/synchronizer/simpleexampleservice-synchronizer.py
index 7caa954..26cc382 100644
--- a/xos/synchronizer/simpleexampleservice-synchronizer.py
+++ b/xos/synchronizer/simpleexampleservice-synchronizer.py
@@ -16,17 +16,18 @@
# Runs the standard XOS synchronizer
-import importlib
import os
-import sys
+from xossynchronizer import Synchronizer
from xosconfig import Config
-config_file = os.path.abspath(os.path.dirname(os.path.realpath(__file__)) + '/simpleexampleservice_config.yaml')
-Config.init(config_file, 'synchronizer-config-schema.yaml')
+base_config_file = os.path.abspath(os.path.dirname(os.path.realpath(__file__)) + '/simpleexampleservice_config.yaml')
+mounted_config_file = os.path.abspath(os.path.dirname(os.path.realpath(__file__)) + '/mounted_config.yaml')
-synchronizer_path = os.path.join(os.path.dirname(
- os.path.realpath(__file__)), "../../synchronizers/new_base")
-sys.path.append(synchronizer_path)
-mod = importlib.import_module("xos-synchronizer")
-mod.main()
+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().run()
+