SEBA-498 Remove old synchronizer framework

Change-Id: Ic663011ad658475d1e887abae52b6d862e686071
diff --git a/lib/xos-synchronizer/requirements.txt b/lib/xos-synchronizer/requirements.txt
index dc7e5b9..ce153d5 100644
--- a/lib/xos-synchronizer/requirements.txt
+++ b/lib/xos-synchronizer/requirements.txt
@@ -6,7 +6,6 @@
 astunparse~=1.5.0
 xosconfig~=2.2.6
 xosgenx~=2.2.6
-xosutil~=2.2.6
 
 # remove once xosconfig/xosgenx are updated with correct requirements.txt
 plyxproto~=4.0.0
diff --git a/lib/xos-synchronizer/xossynchronizer/modelaccessor.py b/lib/xos-synchronizer/xossynchronizer/modelaccessor.py
index b4b26f3..d408ace 100644
--- a/lib/xos-synchronizer/xossynchronizer/modelaccessor.py
+++ b/lib/xos-synchronizer/xossynchronizer/modelaccessor.py
@@ -32,7 +32,6 @@
 from threading import Timer
 
 from xosconfig import Config
-from xosutil.autodiscover_version import autodiscover_version_of_main
 
 from .loadmodels import ModelLoadClient
 
@@ -204,6 +203,19 @@
     after_reactor_exit_code = code
 
 
+def get_synchronizer_version():
+    import __main__ as synchronizer_main
+
+    # VERSION file should be in same directory as the synchronizer's __main__
+    if hasattr(synchronizer_main, "__file__"):
+        version_fn = os.path.join(os.path.dirname(synchronizer_main.__file__), "VERSION")
+        if os.path.exists(version_fn):
+            version = open(version_fn, "rt").readline().strip()
+            if version:
+                return version
+        return "unknown"
+
+
 def grpcapi_reconnect(client, reactor):
     global model_accessor
 
@@ -211,7 +223,7 @@
     # is waiting on our models.
 
     if Config.get("models_dir"):
-        version = autodiscover_version_of_main(max_parent_depth=0) or "unknown"
+        version = get_synchronizer_version()
         log.info("Service version is %s" % version, core_version=Config.get("core_version"))
         try:
             if Config.get("desired_state") == "load":