SEBA-405 Update openstack synchronizer to use synchronizer library

Change-Id: I9adae42fa7eec94ee496b728c32a7ce5db3c39e0
diff --git a/Dockerfile.synchronizer b/Dockerfile.synchronizer
index 2e643f4..9ebe76f 100644
--- a/Dockerfile.synchronizer
+++ b/Dockerfile.synchronizer
@@ -14,7 +14,7 @@
 
 # xosproject/openstack-synchronizer
 
-FROM xosproject/xos-synchronizer-base:2.1.32
+FROM xosproject/xos-synchronizer-base:2.1.38
 
 COPY xos/synchronizer /opt/xos/synchronizers/openstack
 COPY VERSION /opt/xos/synchronizers/openstack/
diff --git a/VERSION b/VERSION
index e25d8d9..0664a8f 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-1.1.5
+1.1.6
diff --git a/xos/synchronizer/__init__.py b/xos/synchronizer/__init__.py
deleted file mode 100644
index 9120126..0000000
--- a/xos/synchronizer/__init__.py
+++ /dev/null
@@ -1,48 +0,0 @@
-
-# Copyright 2017-present Open Networking Foundation
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-
-# FIXME this file needs a refactoring
-observer_disabled = False
-
-def EnableObserver(x):
-    """ used for manage.py --noobserver """
-    global observer_disabled
-    observer_disabled = not x
-
-print_once = True
-
-def notify_observer(model=None, delete=False, pk=None, model_dict={}):
-    if (observer_disabled):
-        global print_once
-        if (print_once):
-            print "The observer is disabled"
-            print_once = False
-        return
-
-    try:
-        from .event_manager import EventSender
-        if (model and delete):
-            if hasattr(model,"__name__"):
-                modelName = model.__name__
-            else:
-                modelName = model.__class__.__name__
-            EventSender().fire(delete_flag = delete, model = modelName, pk = pk, model_dict=model_dict)
-        else:
-            EventSender().fire()
-    except Exception,e:
-        print "Exception in Observer. This should not disrupt the front end. %s"%str(e)
-
-
diff --git a/xos/synchronizer/driver.py b/xos/synchronizer/driver.py
index 21ec9ed..b2c114e 100644
--- a/xos/synchronizer/driver.py
+++ b/xos/synchronizer/driver.py
@@ -17,10 +17,10 @@
 import commands
 import hashlib
 from xosconfig import Config
-from synchronizers.new_base.modelaccessor import *
+from xossynchronizer.modelaccessor import *
 
 try:
-    from synchronizers.openstack.client import OpenStackClient
+    from client import OpenStackClient
     has_openstack = True
 except:
     has_openstack = False
diff --git a/xos/synchronizer/error_mapper.py b/xos/synchronizer/error_mapper.py
index 94b8061..ad2da32 100644
--- a/xos/synchronizer/error_mapper.py
+++ b/xos/synchronizer/error_mapper.py
@@ -14,7 +14,10 @@
 # limitations under the License.
 
 
-from xos.logger import Logger, logging, logger
+from xosconfig import Config
+from multistructlog import create_logger
+
+log = create_logger(Config().get('logging'))
 
 
 class ErrorMapper:
@@ -28,7 +31,7 @@
                     k, v = map(lambda i: i.rstrip(), splits)
                     self.error_map[k] = v
         except:
-            logging.info('Could not read error map')
+            log.info('Could not read error map')
 
     def map(self, error):
         return self.error_map[error]
diff --git a/xos/synchronizer/model_policies/model_policy_Controller.py b/xos/synchronizer/model_policies/model_policy_Controller.py
index 3f33219..0755085 100644
--- a/xos/synchronizer/model_policies/model_policy_Controller.py
+++ b/xos/synchronizer/model_policies/model_policy_Controller.py
@@ -15,8 +15,8 @@
 
 
 from collections import defaultdict
-from synchronizers.new_base.modelaccessor import *
-from synchronizers.new_base.policy import Policy
+from xossynchronizer.modelaccessor import *
+from xossynchronizer.model_policies.policy import Policy
 
 class ControllerPolicy(Policy):
     model_name = "Controller"
diff --git a/xos/synchronizer/model_policies/model_policy_ControllerSite.py b/xos/synchronizer/model_policies/model_policy_ControllerSite.py
index 9f16a32..963788f 100644
--- a/xos/synchronizer/model_policies/model_policy_ControllerSite.py
+++ b/xos/synchronizer/model_policies/model_policy_ControllerSite.py
@@ -14,8 +14,8 @@
 # limitations under the License.
 
 
-from synchronizers.new_base.modelaccessor import *
-from synchronizers.new_base.policy import Policy
+from xossynchronizer.modelaccessor import *
+from xossynchronizer.model_policies.policy import Policy
 
 class ControllerSitePolicy(Policy):
     model_name = "ControllerSite"
diff --git a/xos/synchronizer/model_policies/model_policy_ControllerSlice.py b/xos/synchronizer/model_policies/model_policy_ControllerSlice.py
index 4890459..d671125 100644
--- a/xos/synchronizer/model_policies/model_policy_ControllerSlice.py
+++ b/xos/synchronizer/model_policies/model_policy_ControllerSlice.py
@@ -14,8 +14,8 @@
 # limitations under the License.
 
 
-from synchronizers.new_base.modelaccessor import *
-from synchronizers.new_base.policy import Policy
+from xossynchronizer.modelaccessor import *
+from xossynchronizer.model_policies.policy import Policy
 
 class ControllerSlicePolicy(Policy):
     model_name = "ControllerSlice"
diff --git a/xos/synchronizer/model_policies/model_policy_ControllerUser.py b/xos/synchronizer/model_policies/model_policy_ControllerUser.py
index 83a3886..41ddc30 100644
--- a/xos/synchronizer/model_policies/model_policy_ControllerUser.py
+++ b/xos/synchronizer/model_policies/model_policy_ControllerUser.py
@@ -14,8 +14,8 @@
 # limitations under the License.
 
 
-from synchronizers.new_base.modelaccessor import *
-from synchronizers.new_base.policy import Policy
+from xossynchronizer.modelaccessor import *
+from xossynchronizer.model_policies.policy import Policy
 
 class ControllerUserPolicy(Policy):
     model_name = "ControllerUser"
diff --git a/xos/synchronizer/model_policies/model_policy_Image.py b/xos/synchronizer/model_policies/model_policy_Image.py
index 430e13f..e53c75c 100644
--- a/xos/synchronizer/model_policies/model_policy_Image.py
+++ b/xos/synchronizer/model_policies/model_policy_Image.py
@@ -14,8 +14,8 @@
 # limitations under the License.
 
 
-from synchronizers.new_base.modelaccessor import *
-from synchronizers.new_base.policy import Policy
+from xossynchronizer.modelaccessor import *
+from xossynchronizer.model_policies.policy import Policy
 
 class ImagePolicy(Policy):
     model_name = "Image"
diff --git a/xos/synchronizer/model_policies/model_policy_Instance.py b/xos/synchronizer/model_policies/model_policy_Instance.py
index b81733d..33c5c3a 100644
--- a/xos/synchronizer/model_policies/model_policy_Instance.py
+++ b/xos/synchronizer/model_policies/model_policy_Instance.py
@@ -14,8 +14,8 @@
 # limitations under the License.
 
 
-from synchronizers.new_base.modelaccessor import *
-from synchronizers.new_base.policy import Policy
+from xossynchronizer.modelaccessor import *
+from xossynchronizer.model_policies.policy import Policy
 
 class InstancePolicy(Policy):
     model_name = "Instance"
diff --git a/xos/synchronizer/model_policies/model_policy_Network.py b/xos/synchronizer/model_policies/model_policy_Network.py
index 24ec0dd..09acf6f 100644
--- a/xos/synchronizer/model_policies/model_policy_Network.py
+++ b/xos/synchronizer/model_policies/model_policy_Network.py
@@ -14,9 +14,9 @@
 # limitations under the License.
 
 
-from synchronizers.new_base.modelaccessor import *
 from collections import defaultdict
-from synchronizers.new_base.policy import Policy
+from xossynchronizer.modelaccessor import *
+from xossynchronizer.model_policies.policy import Policy
 
 class NetworkPolicy(Policy):
     model_name = "Network"
diff --git a/xos/synchronizer/model_policies/model_policy_Site.py b/xos/synchronizer/model_policies/model_policy_Site.py
index b169a0b..6be7ff5 100644
--- a/xos/synchronizer/model_policies/model_policy_Site.py
+++ b/xos/synchronizer/model_policies/model_policy_Site.py
@@ -14,8 +14,8 @@
 # limitations under the License.
 
 
-from synchronizers.new_base.modelaccessor import *
-from synchronizers.new_base.policy import Policy
+from xossynchronizer.modelaccessor import *
+from xossynchronizer.model_policies.policy import Policy
 
 class SitePolicy(Policy):
     model_name = "Site"
diff --git a/xos/synchronizer/model_policies/model_policy_SitePrivilege.py b/xos/synchronizer/model_policies/model_policy_SitePrivilege.py
index c38af09..49b0940 100644
--- a/xos/synchronizer/model_policies/model_policy_SitePrivilege.py
+++ b/xos/synchronizer/model_policies/model_policy_SitePrivilege.py
@@ -14,8 +14,8 @@
 # limitations under the License.
 
 
-from synchronizers.new_base.modelaccessor import *
-from synchronizers.new_base.policy import Policy
+from xossynchronizer.modelaccessor import *
+from xossynchronizer.model_policies.policy import Policy
 
 class SitePrivilegePolicy(Policy):
     model_name = "SitePrivilege"
diff --git a/xos/synchronizer/model_policies/model_policy_Slice.py b/xos/synchronizer/model_policies/model_policy_Slice.py
index a48f5a2..a24e9a2 100644
--- a/xos/synchronizer/model_policies/model_policy_Slice.py
+++ b/xos/synchronizer/model_policies/model_policy_Slice.py
@@ -14,8 +14,8 @@
 # limitations under the License.
 
 
-from synchronizers.new_base.modelaccessor import *
-from synchronizers.new_base.policy import Policy
+from xossynchronizer.modelaccessor import *
+from xossynchronizer.model_policies.policy import Policy
 
 class SlicePolicy(Policy):
     model_name = "Slice"
diff --git a/xos/synchronizer/model_policies/model_policy_SlicePrivilege.py b/xos/synchronizer/model_policies/model_policy_SlicePrivilege.py
index 9340997..9b74fc0 100644
--- a/xos/synchronizer/model_policies/model_policy_SlicePrivilege.py
+++ b/xos/synchronizer/model_policies/model_policy_SlicePrivilege.py
@@ -14,8 +14,8 @@
 # limitations under the License.
 
 
-from synchronizers.new_base.modelaccessor import *
-from synchronizers.new_base.policy import Policy
+from xossynchronizer.modelaccessor import *
+from xossynchronizer.model_policies.policy import Policy
 
 class SlicePrivilegePolicy(Policy):
     model_name = "SlicePrivilege"
diff --git a/xos/synchronizer/model_policies/model_policy_User.py b/xos/synchronizer/model_policies/model_policy_User.py
index d81b403..69c264f 100644
--- a/xos/synchronizer/model_policies/model_policy_User.py
+++ b/xos/synchronizer/model_policies/model_policy_User.py
@@ -14,8 +14,8 @@
 # limitations under the License.
 
 
-from synchronizers.new_base.modelaccessor import *
-from synchronizers.new_base.policy import Policy
+from xossynchronizer.modelaccessor import *
+from xossynchronizer.model_policies.policy import Policy
 
 class UserPolicy(Policy):
     model_name = "User"
diff --git a/xos/synchronizer/openstack-synchronizer.py b/xos/synchronizer/openstack-synchronizer.py
index e86e6f3..8d71f3a 100644
--- a/xos/synchronizer/openstack-synchronizer.py
+++ b/xos/synchronizer/openstack-synchronizer.py
@@ -15,10 +15,7 @@
 # limitations under the License.
 
 import os
-import argparse
-import sys
-
-sys.path.append('/opt/xos')
+from xossynchronizer import Synchronizer
 from xosconfig import Config
 
 base_config_file = os.path.abspath(os.path.dirname(os.path.realpath(__file__)) + '/config.yaml')
@@ -29,45 +26,11 @@
 else:
     Config.init(base_config_file, 'synchronizer-config-schema.yaml')
 
-os.environ.setdefault("DJANGO_SETTINGS_MODULE", "xos.settings")
-from xos.logger import Logger, logging, logger
-import time
-
-from synchronizers.new_base.modelaccessor import *
-from synchronizers.new_base.backend import Backend
-from synchronizers.new_base.event_loop import set_driver
-
-logger = Logger(level=logging.INFO)
-
-# TODO: These two lines are the only difference between this file and
-#       new_base/openstack-synchronizer.py. Reconcile these.
-# set the driver.
-from synchronizers.openstack.driver import OpenStackDriver
+from xossynchronizer.event_loop import set_driver
+from driver import OpenStackDriver
 set_driver(OpenStackDriver())
 
+# Update the CA certificates
+os.system("update-ca-certificates")
 
-def main():
-    models_active = False
-    wait = False
-    while not models_active:
-        try:
-            _ = Instance.objects.first()
-            _ = NetworkTemplate.objects.first()
-            models_active = True
-        except Exception,e:
-            logger.info(str(e))
-            logger.info('Waiting for data model to come up before starting...')
-            time.sleep(10)
-            wait = True
-
-    if (wait):
-        time.sleep(60) # Safety factor, seeing that we stumbled waiting for the data model to come up.
-    backend = Backend()
-    backend.run()
-
-if __name__ == '__main__':
-
-    # Update the CA certificates
-    os.system("update-ca-certificates")
-
-    main()
+Synchronizer().run()
diff --git a/xos/synchronizer/openstacksyncstep.py b/xos/synchronizer/openstacksyncstep.py
index bb5fe5e..d62f394 100644
--- a/xos/synchronizer/openstacksyncstep.py
+++ b/xos/synchronizer/openstacksyncstep.py
@@ -14,14 +14,14 @@
 # limitations under the License.
 
 
-from synchronizers.new_base.syncstep import SyncStep
+from xossynchronizer.steps.ansiblesyncstep import AnsibleSyncStep
 
-class OpenStackSyncStep(SyncStep):
+class OpenStackSyncStep(AnsibleSyncStep):
     """ XOS Sync step for copying data to OpenStack
     """
 
     def __init__(self, *args, **kwargs):
-        SyncStep.__init__(self, *args, **kwargs)
+        AnsibleSyncStep.__init__(self, *args, **kwargs)
 
     # TODO(smbaker): This should be explained.
     def __call__(self, **args):
diff --git a/xos/synchronizer/pull_steps/pull_ports.py b/xos/synchronizer/pull_steps/pull_ports.py
index 656cd6b..366454a 100644
--- a/xos/synchronizer/pull_steps/pull_ports.py
+++ b/xos/synchronizer/pull_steps/pull_ports.py
@@ -12,8 +12,8 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-from synchronizers.new_base.pullstep import PullStep
-from synchronizers.new_base.modelaccessor import Network, Port, OpenStackService, OpenStackServiceInstance
+from xossynchronizer.pull_steps.pullstep import PullStep
+from xossynchronizer.modelaccessor import Network, Port, OpenStackService, OpenStackServiceInstance
 
 from xosconfig import Config
 from multistructlog import create_logger
diff --git a/xos/synchronizer/steps/newopenstacksyncstep.py b/xos/synchronizer/steps/newopenstacksyncstep.py
index 1e16b49..c80ffe7 100644
--- a/xos/synchronizer/steps/newopenstacksyncstep.py
+++ b/xos/synchronizer/steps/newopenstacksyncstep.py
@@ -15,7 +15,7 @@
 
 
 from distutils.version import LooseVersion
-from synchronizers.new_base.syncstep import SyncStep
+from xossynchronizer.steps.syncstep import SyncStep
 
 class NewOpenStackSyncStep(SyncStep):
     """ XOS Sync step for copying data to OpenStack
diff --git a/xos/synchronizer/steps/sync_container.py b/xos/synchronizer/steps/sync_container.py
index 476877d..9da1ce5 100644
--- a/xos/synchronizer/steps/sync_container.py
+++ b/xos/synchronizer/steps/sync_container.py
@@ -20,18 +20,19 @@
 import sys
 import base64
 import time
-from synchronizers.new_base.SyncInstanceUsingAnsible import SyncInstanceUsingAnsible
-from synchronizers.new_base.syncstep import DeferredException
-from synchronizers.new_base.ansible_helper import run_template_ssh
-from xos.logger import Logger, logging
-from synchronizers.new_base.modelaccessor import *
+from xossynchronizer.steps.SyncInstanceUsingAnsible import SyncInstanceUsingAnsible
+from xossynchronizer.steps.syncstep import DeferredException
+from xossynchronizer.ansible_helper import run_template_ssh
+from xossynchronizer.modelaccessor import *
+from xosconfig import Config
+from multistructlog import create_logger
+
+log = create_logger(Config().get('logging'))
 
 # hpclibrary will be in steps/..
 parentdir = os.path.join(os.path.dirname(__file__),"..")
 sys.path.insert(0,parentdir)
 
-logger = Logger(level=logging.INFO)
-
 class SyncContainer(SyncInstanceUsingAnsible):
     provides=[Instance]
     observes=Instance
@@ -132,7 +133,7 @@
         return fields
 
     def sync_record(self, o):
-        logger.info("sync'ing object %s" % str(o),extra=o.tologdict())
+        log.info("sync'ing object %s" % str(o),extra=o.tologdict())
 
         fields = self.get_ansible_fields(o)
 
@@ -152,7 +153,7 @@
         o.save()
 
     def delete_record(self, o):
-        logger.info("delete'ing object %s" % str(o),extra=o.tologdict())
+        log.info("delete'ing object %s" % str(o),extra=o.tologdict())
 
         fields = self.get_ansible_fields(o)
 
@@ -171,6 +172,6 @@
             template_name = self.template_name
         tStart = time.time()
         run_template_ssh(template_name, fields, path="container", object=o)
-        logger.info("playbook execution time %d" % int(time.time()-tStart),extra=o.tologdict())
+        log.info("playbook execution time %d" % int(time.time()-tStart),extra=o.tologdict())
 
 
diff --git a/xos/synchronizer/steps/sync_controller_images.py b/xos/synchronizer/steps/sync_controller_images.py
index 67c5a94..e85a94d 100644
--- a/xos/synchronizer/steps/sync_controller_images.py
+++ b/xos/synchronizer/steps/sync_controller_images.py
@@ -12,13 +12,13 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-import os
 import urlparse
-import base64
-from synchronizers.openstack.openstacksyncstep import OpenStackSyncStep
-from synchronizers.new_base.syncstep import *
-from synchronizers.new_base.ansible_helper import *
-from synchronizers.new_base.modelaccessor import *
+from openstacksyncstep import OpenStackSyncStep
+from xossynchronizer.modelaccessor import *
+from xosconfig import Config
+from multistructlog import create_logger
+
+log = create_logger(Config().get('logging'))
 
 class SyncControllerImages(OpenStackSyncStep):
     provides=[ControllerImages]
diff --git a/xos/synchronizer/steps/sync_controller_networks.py b/xos/synchronizer/steps/sync_controller_networks.py
index d33962a..e5c080e 100644
--- a/xos/synchronizer/steps/sync_controller_networks.py
+++ b/xos/synchronizer/steps/sync_controller_networks.py
@@ -19,11 +19,12 @@
 import struct
 import socket
 from netaddr import IPAddress, IPNetwork
-from synchronizers.openstack.openstacksyncstep import OpenStackSyncStep
-from synchronizers.new_base.syncstep import *
-from xos.logger import observer_logger as logger
-from synchronizers.new_base.ansible_helper import *
-from synchronizers.new_base.modelaccessor import *
+from openstacksyncstep import OpenStackSyncStep
+from xossynchronizer.modelaccessor import *
+from xosconfig import Config
+from multistructlog import create_logger
+
+log = create_logger(Config().get('logging'))
 
 class SyncControllerNetworks(OpenStackSyncStep):
     requested_interval = 0
@@ -139,7 +140,7 @@
             return SyncStep.SYNC_WITHOUT_RUNNING
 
         if not controller_network.controller.admin_user:
-            logger.info("controller %r has no admin_user, skipping" % controller_network.controller)
+            log.info("controller %r has no admin_user, skipping" % controller_network.controller)
             return
 
         if controller_network.network.owner and controller_network.network.owner.creator:
diff --git a/xos/synchronizer/steps/sync_controller_site_privileges.py b/xos/synchronizer/steps/sync_controller_site_privileges.py
index 72e5b04..bfe436d 100644
--- a/xos/synchronizer/steps/sync_controller_site_privileges.py
+++ b/xos/synchronizer/steps/sync_controller_site_privileges.py
@@ -17,11 +17,12 @@
 import os
 import base64
 import json
-from synchronizers.openstack.openstacksyncstep import OpenStackSyncStep
-from synchronizers.new_base.syncstep import *
-from xos.logger import observer_logger as logger
-from synchronizers.new_base.ansible_helper import *
-from synchronizers.new_base.modelaccessor import *
+from openstacksyncstep import OpenStackSyncStep
+from xossynchronizer.modelaccessor import *
+from xosconfig import Config
+from multistructlog import create_logger
+
+log = create_logger(Config().get('logging'))
 
 class SyncControllerSitePrivileges(OpenStackSyncStep):
     provides=[SitePrivilege]
diff --git a/xos/synchronizer/steps/sync_controller_sites.py b/xos/synchronizer/steps/sync_controller_sites.py
index f12f477..a4c56a5 100644
--- a/xos/synchronizer/steps/sync_controller_sites.py
+++ b/xos/synchronizer/steps/sync_controller_sites.py
@@ -16,11 +16,14 @@
 
 import os
 import base64
-from synchronizers.openstack.openstacksyncstep import OpenStackSyncStep
-from synchronizers.new_base.syncstep import *
-from synchronizers.new_base.ansible_helper import *
 import json
-from synchronizers.new_base.modelaccessor import *
+from openstacksyncstep import OpenStackSyncStep
+from xossynchronizer.modelaccessor import *
+from xosconfig import Config
+from multistructlog import create_logger
+
+log = create_logger(Config().get('logging'))
+
 
 class SyncControllerSites(OpenStackSyncStep):
     requested_interval=0
diff --git a/xos/synchronizer/steps/sync_controller_slice_privileges.py b/xos/synchronizer/steps/sync_controller_slice_privileges.py
index e598e1c..5e8466e 100644
--- a/xos/synchronizer/steps/sync_controller_slice_privileges.py
+++ b/xos/synchronizer/steps/sync_controller_slice_privileges.py
@@ -17,11 +17,13 @@
 import os
 import base64
 import json
-from synchronizers.openstack.openstacksyncstep import OpenStackSyncStep
-from synchronizers.new_base.syncstep import *
-from synchronizers.new_base.ansible_helper import *
-from xos.logger import observer_logger as logger
-from synchronizers.new_base.modelaccessor import *
+from openstacksyncstep import OpenStackSyncStep
+from xossynchronizer.modelaccessor import *
+from xosconfig import Config
+from multistructlog import create_logger
+
+log = create_logger(Config().get('logging'))
+
 
 class SyncControllerSlicePrivileges(OpenStackSyncStep):
     provides=[SlicePrivilege]
@@ -31,7 +33,7 @@
 
     def map_sync_inputs(self, controller_slice_privilege):
         if not controller_slice_privilege.controller.admin_user:
-            logger.info("controller %r has no admin_user, skipping" % controller_slice_privilege.controller)
+            log.info("controller %r has no admin_user, skipping" % controller_slice_privilege.controller)
             return
 
 	template = os_template_env.get_template('sync_controller_users.yaml')
diff --git a/xos/synchronizer/steps/sync_controller_slices.py b/xos/synchronizer/steps/sync_controller_slices.py
index 15a92ed..1481fb0 100644
--- a/xos/synchronizer/steps/sync_controller_slices.py
+++ b/xos/synchronizer/steps/sync_controller_slices.py
@@ -16,11 +16,13 @@
 
 import os
 import base64
-from synchronizers.openstack.openstacksyncstep import OpenStackSyncStep
-from synchronizers.new_base.syncstep import *
-from synchronizers.new_base.ansible_helper import *
-from xos.logger import observer_logger as logger
-from synchronizers.new_base.modelaccessor import *
+from openstacksyncstep import OpenStackSyncStep
+from xossynchronizer.modelaccessor import *
+from xosconfig import Config
+from multistructlog import create_logger
+
+log = create_logger(Config().get('logging'))
+
 
 class SyncControllerSlices(OpenStackSyncStep):
     provides=[Slice]
@@ -29,10 +31,10 @@
     playbook='sync_controller_slices.yaml'
 
     def map_sync_inputs(self, controller_slice):
-        logger.info("sync'ing slice controller %s" % controller_slice)
+        log.info("sync'ing slice controller %s" % controller_slice)
 
         if not controller_slice.controller.admin_user:
-            logger.info("controller %r has no admin_user, skipping" % controller_slice.controller)
+            log.info("controller %r has no admin_user, skipping" % controller_slice.controller)
             return
 
         controller_users = ControllerUser.objects.filter(user_id=controller_slice.slice.creator.id,
@@ -67,7 +69,7 @@
                 driver = self.driver.admin_driver(controller=controller_slice.controller)
                 driver.shell.nova.quotas.update(tenant_id=tenant_id, instances=int(controller_slice.slice.max_instances))
             except:
-                logger.log_exc('Could not update quota for %s'%controller_slice.slice.name)
+                log.exception('Could not update quota for %s'%controller_slice.slice.name)
                 raise Exception('Could not update quota for %s'%controller_slice.slice.name)
 
             controller_slice.tenant_id = tenant_id
diff --git a/xos/synchronizer/steps/sync_controller_users.py b/xos/synchronizer/steps/sync_controller_users.py
index 72f67da..78f2d80 100644
--- a/xos/synchronizer/steps/sync_controller_users.py
+++ b/xos/synchronizer/steps/sync_controller_users.py
@@ -16,11 +16,12 @@
 
 import os
 import base64
-from synchronizers.openstack.openstacksyncstep import OpenStackSyncStep
-from synchronizers.new_base.syncstep import *
-from synchronizers.new_base.ansible_helper import *
-from xos.logger import observer_logger as logger
-from synchronizers.new_base.modelaccessor import *
+from openstacksyncstep import OpenStackSyncStep
+from xossynchronizer.modelaccessor import *
+from xosconfig import Config
+from multistructlog import create_logger
+
+log = create_logger(Config().get('logging'))
 
 class SyncControllerUsers(OpenStackSyncStep):
     provides=[User]
@@ -30,7 +31,7 @@
 
     def map_sync_inputs(self, controller_user):
         if not controller_user.controller.admin_user:
-            logger.info("controller %r has no admin_user, skipping" % controller_user.controller)
+            log.info("controller %r has no admin_user, skipping" % controller_user.controller)
             return
 
         # All users will have at least the 'user' role at their home site/tenant.
diff --git a/xos/synchronizer/steps/sync_images.py b/xos/synchronizer/steps/sync_images.py
index ffda11d..ad6c6ef 100644
--- a/xos/synchronizer/steps/sync_images.py
+++ b/xos/synchronizer/steps/sync_images.py
@@ -14,11 +14,12 @@
 # limitations under the License.
 
 
-import os
-import base64
-from synchronizers.openstack.openstacksyncstep import OpenStackSyncStep
-from xos.logger import observer_logger as logger
-from synchronizers.new_base.modelaccessor import *
+from openstacksyncstep import OpenStackSyncStep
+from xossynchronizer.modelaccessor import *
+from xosconfig import Config
+from multistructlog import create_logger
+
+log = create_logger(Config().get('logging'))
 
 class SyncImages(OpenStackSyncStep):
     provides=[Image]
diff --git a/xos/synchronizer/steps/sync_instances.py b/xos/synchronizer/steps/sync_instances.py
index 4194f89..ccbcb2c 100644
--- a/xos/synchronizer/steps/sync_instances.py
+++ b/xos/synchronizer/steps/sync_instances.py
@@ -14,14 +14,13 @@
 # limitations under the License.
 
 
-import os
-import base64
 import socket
-from synchronizers.openstack.openstacksyncstep import OpenStackSyncStep
-from synchronizers.new_base.ansible_helper import *
-from synchronizers.new_base.syncstep import *
-from xos.logger import observer_logger as logger
-from synchronizers.new_base.modelaccessor import *
+from openstacksyncstep import OpenStackSyncStep
+from xossynchronizer.modelaccessor import *
+from xosconfig import Config
+from multistructlog import create_logger
+
+log = create_logger(Config().get('logging'))
 
 RESTAPI_HOSTNAME = socket.gethostname()
 RESTAPI_PORT = "8000"
@@ -193,7 +192,7 @@
                              x.controller_id == instance.node.site_deployment.controller.id]
         if controller_images:
             image_name = controller_images[0].image.name
-            logger.info("using image from ControllerImage object: " + str(image_name))
+            log.info("using image from ControllerImage object: " + str(image_name))
 
         if image_name is None:
             controller_driver = self.driver.admin_driver(controller=instance.node.site_deployment.controller)
@@ -201,7 +200,7 @@
             for image in images:
                 if image.name == instance.image.name or not image_name:
                     image_name = image.name
-                    logger.info("using image from glance: " + str(image_name))
+                    log.info("using image from glance: " + str(image_name))
 
         host_filter = instance.node.name.strip()
 
diff --git a/xos/synchronizer/steps/sync_openstack_service.py b/xos/synchronizer/steps/sync_openstack_service.py
index 79e2df8..829abaa 100644
--- a/xos/synchronizer/steps/sync_openstack_service.py
+++ b/xos/synchronizer/steps/sync_openstack_service.py
@@ -14,7 +14,7 @@
 # limitations under the License.
 
 
-from synchronizers.new_base.modelaccessor import OpenStackService
+from xossynchronizer.modelaccessor import OpenStackService
 from newopenstacksyncstep import NewOpenStackSyncStep
 
 class SyncOpenStackService(NewOpenStackSyncStep):
diff --git a/xos/synchronizer/steps/sync_openstackserviceinstance.py b/xos/synchronizer/steps/sync_openstackserviceinstance.py
index 6f32d38..746cc7f 100644
--- a/xos/synchronizer/steps/sync_openstackserviceinstance.py
+++ b/xos/synchronizer/steps/sync_openstackserviceinstance.py
@@ -17,7 +17,7 @@
 import random
 import string
 
-from synchronizers.new_base.modelaccessor import OpenStackServiceInstance, Node, NetworkSlice, Flavor
+from xossynchronizer.modelaccessor import OpenStackServiceInstance, Node, NetworkSlice, Flavor
 from newopenstacksyncstep import NewOpenStackSyncStep
 
 from xosconfig import Config
diff --git a/xos/synchronizer/steps/sync_ports.py b/xos/synchronizer/steps/sync_ports.py
index 27ad67e..03b0133 100644
--- a/xos/synchronizer/steps/sync_ports.py
+++ b/xos/synchronizer/steps/sync_ports.py
@@ -13,12 +13,12 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
+from openstacksyncstep import OpenStackSyncStep
+from xossynchronizer.modelaccessor import *
+from xosconfig import Config
+from multistructlog import create_logger
 
-import os
-import base64
-from synchronizers.openstack.openstacksyncstep import OpenStackSyncStep
-from xos.logger import observer_logger as logger
-from synchronizers.new_base.modelaccessor import *
+log = create_logger(Config().get('logging'))
 
 class SyncPorts(OpenStackSyncStep):
     requested_interval = 0 # 3600
@@ -57,7 +57,7 @@
         return driver
 
     def sync_ports(self):
-        logger.info("sync'ing Ports [delete=False]")
+        log.info("sync'ing Ports [delete=False]")
 
         ports = Port.objects.all()
         ports_by_id = {}
@@ -72,10 +72,6 @@
             for nd in network.controllernetworks.all():
                 networks_by_id[nd.net_id] = network
 
-        #logger.info("networks_by_id = ")
-        #for (network_id, network) in networks_by_id.items():
-        #    logger.info("   %s: %s" % (network_id, network.name))
-
         instances = Instance.objects.all()
         instances_by_instance_uuid = {}
         for instance in instances:
@@ -87,13 +83,13 @@
         templates_by_id = {}
         for controller in Controller.objects.all():
             if not controller.admin_tenant:
-                logger.info("controller %s has no admin_tenant" % controller)
+                log.info("controller %s has no admin_tenant" % controller)
                 continue
             try:
                 driver = self.driver.admin_driver(controller = controller)
                 ports = driver.shell.neutron.list_ports()["ports"]
             except:
-                logger.log_exc("failed to get ports from controller %s" % controller)
+                log.exception("failed to get ports from controller %s" % controller)
                 continue
 
             for port in ports:
@@ -113,7 +109,6 @@
                         templates_by_id[network["id"]] = template
 
         for port in ports_by_id.values():
-            #logger.info("port %s" % str(port))
             if port["id"] in ports_by_neutron_port:
                 # we already have it
                 #logger.info("already accounted for port %s" % port["id"])
@@ -126,7 +121,7 @@
 
             instance = instances_by_instance_uuid.get(port['device_id'], None)
             if not instance:
-                logger.info("no instance for port %s device_id %s" % (port["id"], port['device_id']))
+                log.info("no instance for port %s device_id %s" % (port["id"], port['device_id']))
                 continue
 
             network = networks_by_id.get(port['network_id'], None)
@@ -140,7 +135,7 @@
                          if candidate_network.template == template:
                              network=candidate_network
             if not network:
-                logger.info("no network for port %s network %s" % (port["id"], port["network_id"]))
+                log.info("no network for port %s network %s" % (port["id"], port["network_id"]))
 
                 # we know it's associated with a instance, but we don't know
                 # which network it is part of.
@@ -155,20 +150,20 @@
                 network = None
                 for candidate_network in networks:
                     if (candidate_network.owner == instance.slice):
-                        logger.info("found network %s" % candidate_network)
+                        log.info("found network %s" % candidate_network)
                         network = candidate_network
 
                 if not network:
-                    logger.info("failed to find the correct network for a shared template for port %s network %s" % (port["id"], port["network_id"]))
+                    log.info("failed to find the correct network for a shared template for port %s network %s" % (port["id"], port["network_id"]))
                     continue
 
             if not port["fixed_ips"]:
-                logger.info("port %s has no fixed_ips" % port["id"])
+                log.info("port %s has no fixed_ips" % port["id"])
                 continue
 
             ip=port["fixed_ips"][0]["ip_address"]
             mac=port["mac_address"]
-            logger.info("creating Port (%s, %s, %s, %s)" % (str(network), str(instance), ip, str(port["id"])))
+            log.info("creating Port (%s, %s, %s, %s)" % (str(network), str(instance), ip, str(port["id"])))
 
             ns = Port(network=network,
                                instance=instance,
@@ -179,7 +174,7 @@
             try:
                 ns.save()
             except:
-                logger.log_exc("failed to save port %s" % str(ns))
+                log.exception("failed to save port %s" % str(ns))
                 continue
 
         # For ports that were created by the user, find that ones
@@ -188,23 +183,23 @@
         ports = Port.objects.all()
         ports = [x for x in ports if ((not x.port_id) and (x.instance_id))]
         for port in ports:
-            logger.info("XXX working on port %s" % port)
+            log.info("XXX working on port %s" % port)
             controller = port.instance.node.site_deployment.controller
             slice = port.instance.slice
 
             if controller:
                 cn=[x for x in port.network.controllernetworks.all() if x.controller_id==controller.id]
                 if not cn:
-                    logger.log_exc("no controllernetwork for %s" % port)
+                    log.exception("no controllernetwork for %s" % port)
                     continue
                 cn=cn[0]
                 if cn.lazy_blocked:
                     cn.lazy_blocked=False
                     cn.save()
-                    logger.info("deferring port %s because controllerNetwork was lazy-blocked" % port)
+                    log.info("deferring port %s because controllerNetwork was lazy-blocked" % port)
                     continue
                 if not cn.net_id:
-                    logger.info("deferring port %s because controllerNetwork does not have a port-id yet" % port)
+                    log.info("deferring port %s because controllerNetwork does not have a port-id yet" % port)
                     continue
                 try:
                     driver = self.get_driver(port)
@@ -223,28 +218,28 @@
                         port.ip = neutron_port["fixed_ips"][0]["ip_address"]
                     port.mac = neutron_port["mac_address"]
                     port.xos_created = True
-                    logger.info("created neutron port %s for %s" % (port.port_id, port))
+                    log.info("created neutron port %s for %s" % (port.port_id, port))
                 except:
-                    logger.log_exc("failed to create neutron port for %s" % port)
+                    log.exception("failed to create neutron port for %s" % port)
                     continue
                 port.save()
 
     def delete_ports(self):
-        logger.info("sync'ing Ports [delete=True]")
+        log.info("sync'ing Ports [delete=True]")
         ports = self.fetch_pending(deletion=True)
         for port in ports:
             self.delete_record(port)
 
     def delete_record(self, port):
         if port.xos_created and port.port_id:
-            logger.info("calling openstack to destroy port %s" % port.port_id)
+            log.info("calling openstack to destroy port %s" % port.port_id)
             try:
                 driver = self.get_driver(port)
                 driver.shell.neutron.delete_port(port.port_id)
             except:
-                logger.log_exc("failed to delete port %s from neutron" % port.port_id)
+                log.exception("failed to delete port %s from neutron" % port.port_id)
                 return
 
-        logger.info("Purging port %s" % port)
+        log.info("Purging port %s" % port)
         port.delete(purge=True)
 
diff --git a/xos/synchronizer/steps/sync_principal.py b/xos/synchronizer/steps/sync_principal.py
index 9b401a9..b78923d 100644
--- a/xos/synchronizer/steps/sync_principal.py
+++ b/xos/synchronizer/steps/sync_principal.py
@@ -14,7 +14,7 @@
 # limitations under the License.
 
 
-from synchronizers.new_base.modelaccessor import TrustDomain, Principal
+from xossynchronizer.modelaccessor import TrustDomain, Principal
 from newopenstacksyncstep import NewOpenStackSyncStep
 
 from xosconfig import Config
diff --git a/xos/synchronizer/steps/sync_roles.py b/xos/synchronizer/steps/sync_roles.py
index 8f2d09e..c197159 100644
--- a/xos/synchronizer/steps/sync_roles.py
+++ b/xos/synchronizer/steps/sync_roles.py
@@ -13,12 +13,12 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
+from openstacksyncstep import OpenStackSyncStep
+from xossynchronizer.modelaccessor import *
+from xosconfig import Config
+from multistructlog import create_logger
 
-import os
-import base64
-from synchronizers.openstack.openstacksyncstep import OpenStackSyncStep
-from xos.logger import observer_logger as logger
-from synchronizers.new_base.modelaccessor import *
+log = create_logger(Config().get('logging'))
 
 class SyncRoles(OpenStackSyncStep):
     provides=[Role]
@@ -28,7 +28,7 @@
     def sync_record(self, role):
         if not role.enacted:
             controllers = Controller.objects.all()
-       	    for controller in controllers:
+            for controller in controllers:
                 driver = self.driver.admin_driver(controller=controller)
                 driver.create_role(role.role)
             role.save()
diff --git a/xos/synchronizer/steps/sync_slice.py b/xos/synchronizer/steps/sync_slice.py
index 81ca6dc..ad8a253 100644
--- a/xos/synchronizer/steps/sync_slice.py
+++ b/xos/synchronizer/steps/sync_slice.py
@@ -14,8 +14,7 @@
 # limitations under the License.
 
 
-from synchronizers.new_base.ansible_helper import *
-from synchronizers.new_base.modelaccessor import Slice
+from xossynchronizer.modelaccessor import Slice
 from newopenstacksyncstep import NewOpenStackSyncStep
 
 from xosconfig import Config
diff --git a/xos/synchronizer/steps/sync_trustdomain.py b/xos/synchronizer/steps/sync_trustdomain.py
index 67bf752..1fe66ce 100644
--- a/xos/synchronizer/steps/sync_trustdomain.py
+++ b/xos/synchronizer/steps/sync_trustdomain.py
@@ -14,8 +14,7 @@
 # limitations under the License.
 
 
-from synchronizers.new_base.ansible_helper import *
-from synchronizers.new_base.modelaccessor import TrustDomain
+from xossynchronizer.modelaccessor import TrustDomain
 from newopenstacksyncstep import NewOpenStackSyncStep
 
 from xosconfig import Config
diff --git a/xos/synchronizer/tests/test_sync_openstackserviceinstance.py b/xos/synchronizer/tests/test_sync_openstackserviceinstance.py
index 8f0ad3a..101283f 100644
--- a/xos/synchronizer/tests/test_sync_openstackserviceinstance.py
+++ b/xos/synchronizer/tests/test_sync_openstackserviceinstance.py
@@ -32,6 +32,8 @@
 
         sys.path.append(os.path.join(os.path.abspath(os.path.dirname(os.path.realpath(__file__))), "../steps"))
 
+        self.model_accessor = self.unittest_setup["model_accessor"]
+
         from sync_openstackserviceinstance import SyncOpenStackServiceInstance
         self.step_class = SyncOpenStackServiceInstance
 
@@ -54,7 +56,7 @@
             xos_instance = OpenStackServiceInstance(name="test-instance", slice=self.slice, image=self.image,
                                                     node=self.node, flavor=self.flavor)
 
-            step = self.step_class()
+            step = self.step_class(model_accessor=self.model_accessor)
             fakeconn.compute.servers.return_value = []
             fakeconn.identity.find_project.return_value = MagicMock(id=self.slice.backend_handle)
             fakeconn.identity.find_domain.return_value = MagicMock(id=self.trust_domain.backend_handle)
@@ -87,7 +89,7 @@
             xos_instance = OpenStackServiceInstance(name="test-instance", slice=self.slice, image=self.image,
                                                     node=self.node)
 
-            step = self.step_class()
+            step = self.step_class(model_accessor=self.model_accessor)
             fakeconn.compute.servers.return_value = []
             fakeconn.identity.find_project.return_value = MagicMock(id=self.slice.backend_handle)
             fakeconn.identity.find_domain.return_value = MagicMock(id=self.trust_domain.backend_handle)
@@ -122,7 +124,7 @@
             xos_instance = OpenStackServiceInstance(name="test-instance", slice=self.slice, image=self.image,
                                                     flavor=self.flavor)
 
-            step = self.step_class()
+            step = self.step_class(model_accessor=self.model_accessor)
             fakeconn.compute.servers.return_value = []
             fakeconn.identity.find_project.return_value = MagicMock(id=self.slice.backend_handle)
             fakeconn.identity.find_domain.return_value = MagicMock(id=self.trust_domain.backend_handle)
@@ -160,7 +162,7 @@
             owning_service = Service(name="test_service", public_key="key2")
             self.slice.service = owning_service
 
-            step = self.step_class()
+            step = self.step_class(model_accessor=self.model_accessor)
             fakeconn.compute.servers.return_value = []
             fakeconn.identity.find_project.return_value = MagicMock(id=self.slice.backend_handle)
             fakeconn.identity.find_domain.return_value = MagicMock(id=self.trust_domain.backend_handle)
@@ -197,7 +199,7 @@
             os_instance = MagicMock()
             os_instance.id = "1234"
 
-            step = self.step_class()
+            step = self.step_class(model_accessor=self.model_accessor)
             fakeconn.identity.find_project.return_value = os_instance
             fakeconn.compute.create_server.return_value = None
             fakeconn.compute.servers.return_value = [os_instance]
@@ -215,7 +217,7 @@
             xos_instance = OpenStackServiceInstance(name="test-instance", slice=self.slice, image=self.image,
                                                     node=self.node, flavor=self.flavor)
 
-            step = self.step_class()
+            step = self.step_class(model_accessor=self.model_accessor)
             os_instance = MagicMock()
             os_instance.id = "1234"
             fakeconn.compute.servers.return_value = [os_instance]
diff --git a/xos/synchronizer/tests/test_sync_principal.py b/xos/synchronizer/tests/test_sync_principal.py
index f06ec48..3fd0102 100644
--- a/xos/synchronizer/tests/test_sync_principal.py
+++ b/xos/synchronizer/tests/test_sync_principal.py
@@ -32,6 +32,8 @@
 
         sys.path.append(os.path.join(os.path.abspath(os.path.dirname(os.path.realpath(__file__))), "../steps"))
 
+        self.model_accessor = self.unittest_setup["model_accessor"]
+
         from sync_principal import SyncPrincipal
         self.step_class = SyncPrincipal
 
@@ -50,7 +52,7 @@
 
             xos_principal = Principal(name="test-principal", trust_domain=self.trust_domain)
 
-            step = self.step_class()
+            step = self.step_class(model_accessor=self.model_accessor)
             fakeconn.identity.find_user.return_value = None
             fakeconn.identity.find_domain.return_value = MagicMock(id=trust_domain_id)
 
@@ -73,7 +75,7 @@
             os_user = MagicMock()
             os_user.id = "1234"
 
-            step = self.step_class()
+            step = self.step_class(model_accessor=self.model_accessor)
             fakeconn.identity.find_user.return_value = os_user
             fakeconn.identity.create_user.return_value = None
 
@@ -89,7 +91,7 @@
 
             xos_principal = Principal(name="test-principal", trust_domain=self.trust_domain)
 
-            step = self.step_class()
+            step = self.step_class(model_accessor=self.model_accessor)
             os_user = MagicMock()
             os_user.id = "1234"
             fakeconn.identity.find_user.return_value = os_user
diff --git a/xos/synchronizer/tests/test_sync_slice.py b/xos/synchronizer/tests/test_sync_slice.py
index 384641f..2f1046d 100644
--- a/xos/synchronizer/tests/test_sync_slice.py
+++ b/xos/synchronizer/tests/test_sync_slice.py
@@ -32,6 +32,8 @@
 
         sys.path.append(os.path.join(os.path.abspath(os.path.dirname(os.path.realpath(__file__))), "../steps"))
 
+        self.model_accessor = self.unittest_setup["model_accessor"]
+
         from sync_slice import SyncSlice
         self.step_class = SyncSlice
 
@@ -51,7 +53,7 @@
 
             xos_slice = Slice(name="test-slice", trust_domain=self.trust_domain, site=self.site)
 
-            step = self.step_class()
+            step = self.step_class(model_accessor=self.model_accessor)
             fakeconn.identity.find_project.return_value = None
             fakeconn.identity.find_domain.return_value = MagicMock(id=trust_domain_id)
 
@@ -74,7 +76,7 @@
             os_slice = MagicMock()
             os_slice.id = "1234"
 
-            step = self.step_class()
+            step = self.step_class(model_accessor=self.model_accessor)
             fakeconn.identity.find_project.return_value = os_slice
             fakeconn.identity.create_user.return_value = None
 
@@ -90,7 +92,7 @@
 
             xos_slice = Slice(name="test-slice", trust_domain=self.trust_domain, site=self.site)
 
-            step = self.step_class()
+            step = self.step_class(model_accessor=self.model_accessor)
             os_slice = MagicMock()
             os_slice.id = "1234"
             fakeconn.identity.find_project.return_value = os_slice
diff --git a/xos/synchronizer/tests/test_sync_trustdomain.py b/xos/synchronizer/tests/test_sync_trustdomain.py
index b9f8a74..73b574c 100644
--- a/xos/synchronizer/tests/test_sync_trustdomain.py
+++ b/xos/synchronizer/tests/test_sync_trustdomain.py
@@ -32,6 +32,8 @@
 
         sys.path.append(os.path.join(os.path.abspath(os.path.dirname(os.path.realpath(__file__))), "../steps"))
 
+        self.model_accessor = self.unittest_setup["model_accessor"]
+
         from sync_trustdomain import SyncTrustDomain
         self.step_class = SyncTrustDomain
 
@@ -47,7 +49,7 @@
 
             xos_trust_domain = TrustDomain(name="test-trust", owner=self.service)
 
-            step = self.step_class()
+            step = self.step_class(model_accessor=self.model_accessor)
             fakeconn.identity.find_domain.return_value = None
 
             os_domain = MagicMock()
@@ -66,7 +68,7 @@
 
             xos_trust_domain = TrustDomain(name="test-trust", owner=self.service)
 
-            step = self.step_class()
+            step = self.step_class(model_accessor=self.model_accessor)
             os_domain = MagicMock()
             os_domain.id = "1234"
             fakeconn.identity.find_domain.return_value = os_domain
@@ -85,7 +87,7 @@
 
             xos_trust_domain = TrustDomain(name="test-trust", owner=self.service)
 
-            step = self.step_class()
+            step = self.step_class(model_accessor=self.model_accessor)
             os_domain = MagicMock()
             os_domain.id = "1234"
             os_domain.enabled = True
diff --git a/xos/synchronizer/tests/unit_test_common.py b/xos/synchronizer/tests/unit_test_common.py
index 68f6743..c2cdde8 100644
--- a/xos/synchronizer/tests/unit_test_common.py
+++ b/xos/synchronizer/tests/unit_test_common.py
@@ -18,15 +18,14 @@
 
 def setup_sync_unit_test(test_path, globals_dict, models, config_fn="test_config.yaml"):
     """ Perform the common steps associated with setting up a synchronizer unit test.
-           1) Add synchronizers/new_base to sys.path
-           2) Import xosconfig.Config and set it up to test_config.yaml in the current dir
-           3) Build the mock modelaccessor and import it
-           4) Import all model accessor classes into global space
+           1) Import xosconfig.Config and set it up to test_config.yaml in the current dir
+           2) Build the mock modelaccessor and import it
+           3) Import all model accessor classes into global space
 
         Arguments:
             test_path - path to the test case that is being run
             globals_dict - a dictionary to add global models to
-            models - a list of pairs (service_name, xproto_name,
+            models - a list of pairs (service_name, xproto_name)
             config_fn - filename of config file)
 
         Returns:
@@ -37,39 +36,23 @@
                 xos_dir: xos directory
                 services_dir: services directory
     """
-    def get_models_fn(services_dir, service_name, xproto_name):
-        name = os.path.join(service_name, "xos", xproto_name)
-        if os.path.exists(os.path.join(services_dir, name)):
-            return name
-        else:
-            name = os.path.join(service_name, "xos", "synchronizer", "models", xproto_name)
-            if os.path.exists(os.path.join(services_dir, name)):
-                return name
-        raise Exception("Unable to find service=%s xproto=%s" % (service_name, xproto_name))
-
     sys_path_save = sys.path
 
-    xos_dir = os.path.join(test_path, "../../..")
-    if not os.path.exists(os.path.join(test_path, "new_base")):
-        xos_dir = os.path.join(test_path, "../../../../../../orchestration/xos/xos")
-        services_dir = os.path.join(xos_dir, "../../xos_services")
-    sys.path.append(xos_dir)
-    sys.path.append(os.path.join(xos_dir, 'synchronizers', 'new_base'))
-
     # Setting up the config module
     from xosconfig import Config
     config = os.path.join(test_path, config_fn)
     Config.clear()
     Config.init(config, "synchronizer-config-schema.yaml")
 
-    xprotos = []
-    for (service_name, xproto_name) in models:
-        xprotos.append(get_models_fn(services_dir, service_name, xproto_name))
+    from xossynchronizer.mock_modelaccessor_build import mock_modelaccessor_config
+    mock_modelaccessor_config(test_path, models)
 
-    from synchronizers.new_base.mock_modelaccessor_build import build_mock_modelaccessor
-    build_mock_modelaccessor(xos_dir, services_dir, xprotos)
-    import synchronizers.new_base.modelaccessor
-    from synchronizers.new_base.modelaccessor import model_accessor
+    import xossynchronizer.modelaccessor
+    reload(xossynchronizer.modelaccessor)  # in case nose2 loaded it in a previous testp
+
+    from xossynchronizer.modelaccessor import model_accessor
+
+    # modelaccessor.py will have ensure mock_modelaccessor is in sys.path
     from mock_modelaccessor import MockObjectList
 
     # import all class names to globals
@@ -79,6 +62,4 @@
     return {"sys_path_save": sys_path_save,
             "model_accessor": model_accessor,
             "Config": Config,
-            "xos_dir": xos_dir,
-            "services_dir": services_dir,
             "MockObjectList": MockObjectList}