SEBA-405 Update exampleservice to use synchronizer library
Change-Id: Icaf8223b4033815826a6aa6086143e3c9b7a8f60
diff --git a/Dockerfile.synchronizer b/Dockerfile.synchronizer
index 7e5574a..87f87b6 100644
--- a/Dockerfile.synchronizer
+++ b/Dockerfile.synchronizer
@@ -14,7 +14,7 @@
# xosproject/exampleservice-synchronizer
-FROM xosproject/xos-synchronizer-base:2.1.32
+FROM xosproject/xos-synchronizer-base:2.1.38
COPY xos/synchronizer /opt/xos/synchronizers/exampleservice
COPY VERSION /opt/xos/synchronizers/exampleservice/
diff --git a/VERSION b/VERSION
index 530cdd9..21bb5e1 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-2.2.4
+2.2.5
diff --git a/xos/synchronizer/exampleservice-synchronizer.py b/xos/synchronizer/exampleservice-synchronizer.py
index 06fea1b..5e83992 100644
--- a/xos/synchronizer/exampleservice-synchronizer.py
+++ b/xos/synchronizer/exampleservice-synchronizer.py
@@ -18,9 +18,8 @@
# ExampleService Synchronizer. This loads the config file and starts the synchronizer
-import importlib
import os
-import sys
+from xossynchronizer import Synchronizer
from xosconfig import Config
base_config_file = os.path.abspath(os.path.dirname(os.path.realpath(__file__)) + '/config.yaml')
@@ -31,9 +30,5 @@
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)
-mod = importlib.import_module("xos-synchronizer")
-mod.main()
+Synchronizer().run()
diff --git a/xos/synchronizer/model_policies/model_policy_exampleserviceinstance.py b/xos/synchronizer/model_policies/model_policy_exampleserviceinstance.py
index 5e20122..2ee47eb 100644
--- a/xos/synchronizer/model_policies/model_policy_exampleserviceinstance.py
+++ b/xos/synchronizer/model_policies/model_policy_exampleserviceinstance.py
@@ -14,9 +14,9 @@
# limitations under the License.
-from synchronizers.new_base.modelaccessor import OpenStackService, Service
-from synchronizers.new_base.policy import Policy
-from synchronizers.new_base.model_policies.model_policy_tenantwithcontainer import LeastLoadedNodeScheduler
+from xossynchronizer.modelaccessor import OpenStackService, Service
+from xossynchronizer.model_policies.policy import Policy
+from xossynchronizer.model_policies.model_policy_tenantwithcontainer import LeastLoadedNodeScheduler
class ExampleServiceInstancePolicy(Policy):
model_name = "ExampleServiceInstance"
diff --git a/xos/synchronizer/steps/sync_exampleserviceinstance.py b/xos/synchronizer/steps/sync_exampleserviceinstance.py
index fb54d62..e2f77d6 100644
--- a/xos/synchronizer/steps/sync_exampleserviceinstance.py
+++ b/xos/synchronizer/steps/sync_exampleserviceinstance.py
@@ -15,11 +15,10 @@
import os
-import sys
import time
-from synchronizers.new_base.syncstep import SyncStep, DeferredException
-from synchronizers.new_base.ansible_helper import run_template_ssh
-from synchronizers.new_base.modelaccessor import ExampleServiceInstance
+from xossynchronizer.steps.syncstep import SyncStep, DeferredException
+from xossynchronizer.ansible_helper import run_template_ssh
+from xossynchronizer.modelaccessor import ExampleServiceInstance
from xosconfig import Config
from multistructlog import create_logger