diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..485dee6
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1 @@
+.idea
diff --git a/xos/openstack-onboard.yaml b/xos/openstack-onboard.yaml
index d92a6c6..c096bee 100644
--- a/xos/openstack-onboard.yaml
+++ b/xos/openstack-onboard.yaml
@@ -12,5 +12,5 @@
       properties:
           base_url: file:///opt/xos_services/openstack/xos/
           synchronizer: synchronizer/manifest
-          synchronizer_run: xos-synchronizer.py
+          synchronizer_run: openstack-synchronizer.py
 
diff --git a/xos/synchronizer/__init__.py b/xos/synchronizer/__init__.py
index e56cd39..9b61dfb 100644
--- a/xos/synchronizer/__init__.py
+++ b/xos/synchronizer/__init__.py
@@ -1,9 +1,5 @@
-from xos.config import Config
-
-try:
-    observer_disabled = Config().observer_disabled
-except:
-    observer_disabled = False
+# FIXME this file needs a refactoring
+observer_disabled = False
 
 def EnableObserver(x):
     """ used for manage.py --noobserver """
diff --git a/xos/synchronizer/client.py b/xos/synchronizer/client.py
index d1383f4..872ab89 100644
--- a/xos/synchronizer/client.py
+++ b/xos/synchronizer/client.py
@@ -1,17 +1,20 @@
 import urlparse
+
 try:
     from keystoneauth1.identity import v2 as keystoneauth_v2
     from keystoneauth1 import session as keystone_session
     from keystoneclient.v2_0 import client as keystone_client
-    #from glance import client as glance_client
+    # from glance import client as glance_client
     import glanceclient
     from novaclient.v2 import client as nova_client
-    from neutronclient.v2_0 import client as neutron_client 
+    from neutronclient.v2_0 import client as neutron_client
+
     has_openstack = True
 except:
     has_openstack = False
 
-from xos.config import Config
+from xosconfig import Config
+
 
 def require_enabled(callable):
     def wrapper(*args, **kwds):
@@ -19,8 +22,10 @@
             return callable(*args, **kwds)
         else:
             return None
+
     return wrapper
 
+
 def parse_novarc(filename):
     opts = {}
     f = open(filename, 'r')
@@ -37,9 +42,11 @@
     f.close()
     return opts
 
+
 class Client:
-    def __init__(self, username=None, password=None, tenant=None, url=None, token=None, endpoint=None, controller=None, cacert=None, admin=True, *args, **kwds):
-       
+    def __init__(self, username=None, password=None, tenant=None, url=None, token=None, endpoint=None, controller=None,
+                 cacert=None, admin=True, *args, **kwds):
+
         self.has_openstack = has_openstack
         self.url = controller.auth_url
         if admin:
@@ -60,17 +67,15 @@
         if url:
             self.url = url
         if token:
-            self.token = token    
+            self.token = token
         if endpoint:
             self.endpoint = endpoint
 
         if cacert:
             self.cacert = cacert
         else:
-            self.cacert = getattr(Config(), "nova_ca_ssl_cert", "None")
+            self.cacert = Config.get("nova.ca_ssl_cert")
 
-        #if '@' in self.username:
-        #    self.username = self.username[:self.username.index('@')]
 
 class KeystoneClient(Client):
     def __init__(self, *args, **kwds):
@@ -98,46 +103,49 @@
         Client.__init__(self, *args, **kwds)
         if has_openstack:
             self.client = glanceclient.get_client(host='0.0.0.0',
-                                                   username=self.username,
-                                                   password=self.password,
-                                                   tenant=self.tenant,
-                                                   auth_url=self.url,
-                                                   cacert=self.cacert
-                                                   )
+                                                  username=self.username,
+                                                  password=self.password,
+                                                  tenant=self.tenant,
+                                                  auth_url=self.url,
+                                                  cacert=self.cacert
+                                                  )
+
     @require_enabled
     def __getattr__(self, name):
         return getattr(self.client, name)
 
+
 class GlanceClient(Client):
     def __init__(self, version, endpoint, token, cacert=None, *args, **kwds):
         Client.__init__(self, *args, **kwds)
         if has_openstack:
-            self.client = glanceclient.Client(version, 
-                endpoint=endpoint, 
-                token=token,
-                cacert=cacert
-            )
+            self.client = glanceclient.Client(version,
+                                              endpoint=endpoint,
+                                              token=token,
+                                              cacert=cacert
+                                              )
 
     @require_enabled
     def __getattr__(self, name):
-        return getattr(self.client, name)        
+        return getattr(self.client, name)
+
 
 class NovaClient(Client):
     def __init__(self, *args, **kwds):
         Client.__init__(self, *args, **kwds)
         if has_openstack:
             self.client = nova_client.client.Client(
-                    "2",
-                    username=self.username,
-                    api_key=self.password,
-                    project_id=self.tenant,
-                    auth_url=self.url,
-                    region_name='',
-                    extensions=[],
-                    service_type='compute',
-                    service_name='',
-                    cacert=self.cacert
-                    )
+                "2",
+                username=self.username,
+                api_key=self.password,
+                project_id=self.tenant,
+                auth_url=self.url,
+                region_name='',
+                extensions=[],
+                service_type='compute',
+                service_name='',
+                cacert=self.cacert
+            )
 
     @require_enabled
     def connect(self, *args, **kwds):
@@ -147,6 +155,7 @@
     def __getattr__(self, name):
         return getattr(self.client, name)
 
+
 class NovaDB(Client):
     def __init__(self, *args, **kwds):
         Client.__init__(self, *args, **kwds)
@@ -155,7 +164,6 @@
             nova_db_api.FLAGS(default_config_files=['/etc/nova/nova.conf'])
             self.client = nova_db_api
 
-
     @require_enabled
     def connect(self, *args, **kwds):
         self.__init__(*args, **kwds)
@@ -164,6 +172,7 @@
     def __getattr__(self, name):
         return getattr(self.client, name)
 
+
 class NeutronClient(Client):
     def __init__(self, *args, **kwds):
         Client.__init__(self, *args, **kwds)
@@ -174,6 +183,7 @@
                                                 auth_url=self.url,
                                                 ca_cert=self.cacert
                                                 )
+
     @require_enabled
     def connect(self, *args, **kwds):
         self.__init__(*args, **kwds)
@@ -182,24 +192,26 @@
     def __getattr__(self, name):
         return getattr(self.client, name)
 
+
 class OpenStackClient:
     """
     A simple native shell to the openstack backend services.
     This class can receive all nova calls to the underlying testbed
     """
 
-    def __init__ ( self, *args, **kwds) :
+    def __init__(self, *args, **kwds):
         # instantiate managers
         self.keystone = KeystoneClient(*args, **kwds)
         url_parsed = urlparse.urlparse(self.keystone.url)
         hostname = url_parsed.netloc.split(':')[0]
-        token = self.keystone.client.tokens.authenticate(username=self.keystone.username, password=self.keystone.password, tenant_name=self.keystone.tenant)
-#        glance_endpoint = self.keystone.client.service_catalog.url_for(service_type='image', endpoint_type='publicURL')
-#        self.glanceclient = GlanceClient('1', endpoint=glance_endpoint, token=token.id, **kwds)
+        token = self.keystone.client.tokens.authenticate(username=self.keystone.username,
+                                                         password=self.keystone.password,
+                                                         tenant_name=self.keystone.tenant)
+        #        glance_endpoint = self.keystone.client.service_catalog.url_for(service_type='image', endpoint_type='publicURL')
+        #        self.glanceclient = GlanceClient('1', endpoint=glance_endpoint, token=token.id, **kwds)
         self.nova = NovaClient(*args, **kwds)
         # self.nova_db = NovaDB(*args, **kwds)
         self.neutron = NeutronClient(*args, **kwds)
-    
 
     @require_enabled
     def connect(self, *args, **kwds):
diff --git a/xos/synchronizer/driver.py b/xos/synchronizer/driver.py
index 1e795e4..8135fa6 100644
--- a/xos/synchronizer/driver.py
+++ b/xos/synchronizer/driver.py
@@ -1,6 +1,6 @@
 import commands
 import hashlib
-from xos.config import Config
+from xosconfig import Config
 from synchronizers.new_base.modelaccessor import *
 
 try:
@@ -9,15 +9,11 @@
 except:
     has_openstack = False
 
-manager_enabled = Config().api_nova_enabled
+manager_enabled = Config.get("nova.enabled")
 
 class OpenStackDriver:
 
     def __init__(self, config = None, client=None):
-        if config:
-            self.config = Config(config)
-        else:
-            self.config = Config()
 
         if client:
             self.shell = client
@@ -32,7 +28,7 @@
             auth = {'username': caller.email,
                     'password': hashlib.md5(caller.password).hexdigest()[:6],
                     'tenant': tenant}
-            client = OpenStackClient(controller=controller, cacert=self.config.nova_ca_ssl_cert, **auth)
+            client = OpenStackClient(controller=controller, cacert=Config.get("nova.ca_ssl_cert"), **auth)
         else:
             admin_driver = self.admin_driver(tenant=tenant, controller=controller)
             client = OpenStackClient(tenant=tenant, controller=admin_driver.controller)
@@ -47,7 +43,7 @@
             controller = Controller.objects.get(id=controller.id)
         if not tenant:
             tenant = controller.admin_tenant
-        client = OpenStackClient(tenant=tenant, controller=controller, cacert=self.config.nova_ca_ssl_cert)
+        client = OpenStackClient(tenant=tenant, controller=controller, cacert=Config.get("nova.ca_ssl_cert"))
         driver = OpenStackDriver(client=client)
         driver.admin_user = client.keystone.users.find(name=controller.admin_user)
         driver.controller = controller
@@ -425,12 +421,12 @@
 
     def spawn_instance(self, name, key_name=None, availability_zone=None, hostname=None, image_id=None, security_group=None, pubkeys=[], nics=None, metadata=None, userdata=None, flavor_name=None):
         if not flavor_name:
-            flavor_name = self.config.nova_default_flavor
+            flavor_name = Config.get("nova.default_flavor")
 
         flavor = self.shell.nova.flavors.find(name=flavor_name)
 
         if not security_group:
-            security_group = self.config.nova_default_security_group
+            security_group = Config.get("nova.default_security_group")
 
         files = {}
         #if pubkeys:
diff --git a/xos/synchronizer/error_mapper.py b/xos/synchronizer/error_mapper.py
index 9eb878d..8bb02d3 100644
--- a/xos/synchronizer/error_mapper.py
+++ b/xos/synchronizer/error_mapper.py
@@ -1,25 +1,18 @@
-from xos.config import Config
 from xos.logger import Logger, logging, logger
 
+
 class ErrorMapper:
-	def __init__(self, error_map_file):
-		self.error_map = {}
-		try:
-			error_map_lines = open(error_map_file).read().splitlines()
-			for l in error_map_lines:
-				if (not l.startswith('#')):
-					splits = l.split('->')
-					k,v = map(lambda i:i.rstrip(),splits)
-					self.error_map[k]=v
-		except:
-			logging.info('Could not read error map')
+    def __init__(self, error_map_file):
+        self.error_map = {}
+        try:
+            error_map_lines = open(error_map_file).read().splitlines()
+            for l in error_map_lines:
+                if (not l.startswith('#')):
+                    splits = l.split('->')
+                    k, v = map(lambda i: i.rstrip(), splits)
+                    self.error_map[k] = v
+        except:
+            logging.info('Could not read error map')
 
-
-	def map(self, error):
-		return self.error_map[error]
-
-
-
-
-
-
+    def map(self, error):
+        return self.error_map[error]
diff --git a/xos/synchronizer/openstack-synchronizer.py b/xos/synchronizer/openstack-synchronizer.py
new file mode 100644
index 0000000..fe6bab2
--- /dev/null
+++ b/xos/synchronizer/openstack-synchronizer.py
@@ -0,0 +1,50 @@
+#!/usr/bin/env python
+import os
+import argparse
+import sys
+
+sys.path.append('/opt/xos')
+from xosconfig import Config
+
+config_file = os.path.abspath(os.path.dirname(os.path.realpath(__file__)) + '/openstack_config.yaml')
+Config.init(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
+set_driver(OpenStackDriver())
+
+
+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__':
+    
+    main() 
diff --git a/xos/synchronizer/openstack_config.yaml b/xos/synchronizer/openstack_config.yaml
new file mode 100644
index 0000000..b904e1c
--- /dev/null
+++ b/xos/synchronizer/openstack_config.yaml
@@ -0,0 +1,24 @@
+name: openstack-synchronizer
+accessor:
+  username: xosadmin@opencord.org
+  password: "@/opt/xos/services/openstack/credentials/xosadmin@opencord.org"
+dependency_graph: "/opt/xos/synchronizers/openstack/model-deps"
+steps_dir: "/opt/xos/synchronizers/openstack/steps"
+sys_dir: "/opt/xos/synchronizers/openstack/sys"
+model_policies_dir: "/opt/xos/synchronizers/openstack/model_policies"
+images_directory: "/opt/xos/images"
+required_models:
+  - ControllerImages
+  - ControllerNetwork
+  - ControllerSitePrivilege
+  - ControllerSite
+  - ControllerSlicePrivilege
+  - ControllerSlice
+  - ControllerUser
+  - Image
+  - Instance
+  - Port
+  - Role
+nova:
+  ca_ssl_cert: "/etc/ssl/certs/ca-certificates.crt"
+  enabled: True
\ No newline at end of file
diff --git a/xos/synchronizer/openstack_from_api_config b/xos/synchronizer/openstack_from_api_config
deleted file mode 100644
index 486e848..0000000
--- a/xos/synchronizer/openstack_from_api_config
+++ /dev/null
@@ -1,30 +0,0 @@
-[api]
-nova_enabled=True
-
-[nova]
-ca_ssl_cert=/etc/ssl/certs/ca-certificates.crt
-
-[log]
-file=console
-level=debug
-
-# Sets options for the synchronizer
-[observer]
-name=openstack
-dependency_graph=/opt/xos/synchronizers/openstack/model-deps
-steps_dir=/opt/xos/synchronizers/openstack/steps
-sys_dir=/opt/xos/synchronizers/openstack/sys
-model_policies_dir=/opt/xos/synchronizers/openstack/model_policies
-#logfile=/var/log/xos_backend.log
-log_file=console
-log_level=debug
-pretend=False
-backoff_disabled=True
-save_ansible_output=True
-accessor_kind=api
-accessor_password=@/opt/xos/services/openstack/credentials/xosadmin@opencord.org
-images_directory=/opt/xos/images
-required_models=ControllerImages,ControllerNetwork,ControllerSitePrivilege,ControllerSite,ControllerSlicePrivilege,ControllerSlice,ControllerUser,Image,Instance,Port,Role
-
-[networking]
-use_vtn=True
diff --git a/xos/synchronizer/openstack_synchronizer_config b/xos/synchronizer/openstack_synchronizer_config
deleted file mode 100644
index 3b7f8e9..0000000
--- a/xos/synchronizer/openstack_synchronizer_config
+++ /dev/null
@@ -1,31 +0,0 @@
-[db]
-name=xos
-user=postgres
-password=password
-host=xos_db
-port=5432
-
-[api]
-nova_enabled=True
-
-[nova]
-ca_ssl_cert=/etc/ssl/certs/ca-certificates.crt
-
-[observer]
-name=openstack
-dependency_graph=/opt/xos/model-deps
-steps_dir=/opt/xos/synchronizers/openstack/steps
-sys_dir=/opt/xos/synchronizers/openstack/sys
-model_policies_dir=/opt/xos/synchronizers/openstack/model_policies
-logfile=/var/log/xos_backend.log
-save_ansible_output=True
-backoff_disabled=True
-pretend=False
-images_directory=/opt/xos/images
-
-[feefie]
-client_id='vicci_dev_central'
-user_id='pl'
-
-[networking]
-use_vtn=True
diff --git a/xos/synchronizer/run-from-api.sh b/xos/synchronizer/run-from-api.sh
index 031528e..b91460f 100755
--- a/xos/synchronizer/run-from-api.sh
+++ b/xos/synchronizer/run-from-api.sh
@@ -1,2 +1 @@
-export XOS_DIR=/opt/xos
-python xos-synchronizer.py  -C $XOS_DIR/synchronizers/openstack/openstack_from_api_config
+python openstack-synchronizer.py
diff --git a/xos/synchronizer/steps/purge_disabled_users.py b/xos/synchronizer/steps/purge_disabled_users.py
deleted file mode 100644
index 425d4e4..0000000
--- a/xos/synchronizer/steps/purge_disabled_users.py
+++ /dev/null
@@ -1,24 +0,0 @@
-import os
-import base64
-import datetime
-from xos.config import Config
-from synchronizers.openstack.openstacksyncstep import OpenStackSyncStep
-from xos.logger import observer_logger as logger
-from synchronizers.new_base.modelaccessor import *
-
-#class SyncRoles(OpenStackSyncStep):
-#    provides=[User]
-#    requested_interval=0
-#    observes=User
-#
-#    def fetch_pending(self, deleted):
-#        if (deleted):
-#            # users marked as deleted
-#            return User.deleted_objects.all()
-#        else:
-#            # disabled users that haven't been updated in over a week
-#            one_week_ago = datetime.datetime.now() - datetime.timedelta(days=7)
-#            return User.objects.filter(is_active=False, updated__gt=one_week_ago)
-#
-#    def sync_record(self, user):
-#        user.delete()
diff --git a/xos/synchronizer/steps/sync_container.py b/xos/synchronizer/steps/sync_container.py
index 7b69fa5..bc7fd22 100644
--- a/xos/synchronizer/steps/sync_container.py
+++ b/xos/synchronizer/steps/sync_container.py
@@ -4,7 +4,6 @@
 import sys
 import base64
 import time
-from xos.config import Config
 from synchronizers.new_base.SyncInstanceUsingAnsible import SyncInstanceUsingAnsible
 from synchronizers.new_base.syncstep import DeferredException
 from synchronizers.new_base.ansible_helper import run_template_ssh
diff --git a/xos/synchronizer/steps/sync_controller_images.py b/xos/synchronizer/steps/sync_controller_images.py
index 2241fec..721209f 100644
--- a/xos/synchronizer/steps/sync_controller_images.py
+++ b/xos/synchronizer/steps/sync_controller_images.py
@@ -1,9 +1,7 @@
 import os
 import base64
-from xos.config import Config
 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 *
 
diff --git a/xos/synchronizer/steps/sync_controller_networks.py b/xos/synchronizer/steps/sync_controller_networks.py
index 329bb57..124574f 100644
--- a/xos/synchronizer/steps/sync_controller_networks.py
+++ b/xos/synchronizer/steps/sync_controller_networks.py
@@ -3,12 +3,10 @@
 import struct
 import socket
 from netaddr import IPAddress, IPNetwork
-from xos.config import Config
 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 xos.config import Config
 from synchronizers.new_base.modelaccessor import *
 
 class SyncControllerNetworks(OpenStackSyncStep):
@@ -89,7 +87,7 @@
                     'gateway': controller_network.gateway,
                     'start_ip':start_ip,
                     'end_ip':end_ip,
-                    'use_vtn':getattr(Config(), "networking_use_vtn", False),
+                    'use_vtn':True,
                     'delete':False
                     }
         return network_fields
diff --git a/xos/synchronizer/steps/sync_controller_site_privileges.py b/xos/synchronizer/steps/sync_controller_site_privileges.py
index 2768090..cc41341 100644
--- a/xos/synchronizer/steps/sync_controller_site_privileges.py
+++ b/xos/synchronizer/steps/sync_controller_site_privileges.py
@@ -1,7 +1,6 @@
 import os
 import base64
 import json
-from xos.config import Config
 from synchronizers.openstack.openstacksyncstep import OpenStackSyncStep
 from synchronizers.new_base.syncstep import *
 from xos.logger import observer_logger as logger
diff --git a/xos/synchronizer/steps/sync_controller_sites.py b/xos/synchronizer/steps/sync_controller_sites.py
index ba489aa..fbdc454 100644
--- a/xos/synchronizer/steps/sync_controller_sites.py
+++ b/xos/synchronizer/steps/sync_controller_sites.py
@@ -1,10 +1,8 @@
 import os
 import base64
-from xos.config import Config
 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
 import json
 from synchronizers.new_base.modelaccessor import *
 
diff --git a/xos/synchronizer/steps/sync_controller_slice_privileges.py b/xos/synchronizer/steps/sync_controller_slice_privileges.py
index 3a2d167..a2aa3a4 100644
--- a/xos/synchronizer/steps/sync_controller_slice_privileges.py
+++ b/xos/synchronizer/steps/sync_controller_slice_privileges.py
@@ -1,7 +1,6 @@
 import os
 import base64
 import json
-from xos.config import Config
 from synchronizers.openstack.openstacksyncstep import OpenStackSyncStep
 from synchronizers.new_base.syncstep import *
 from synchronizers.new_base.ansible_helper import *
diff --git a/xos/synchronizer/steps/sync_controller_slices.py b/xos/synchronizer/steps/sync_controller_slices.py
index a01c2b2..3cac6a9 100644
--- a/xos/synchronizer/steps/sync_controller_slices.py
+++ b/xos/synchronizer/steps/sync_controller_slices.py
@@ -1,6 +1,5 @@
 import os
 import base64
-from xos.config import Config
 from synchronizers.openstack.openstacksyncstep import OpenStackSyncStep
 from synchronizers.new_base.syncstep import *
 from synchronizers.new_base.ansible_helper import *
diff --git a/xos/synchronizer/steps/sync_controller_users.py b/xos/synchronizer/steps/sync_controller_users.py
index 449dc11..7a67fd0 100644
--- a/xos/synchronizer/steps/sync_controller_users.py
+++ b/xos/synchronizer/steps/sync_controller_users.py
@@ -1,6 +1,5 @@
 import os
 import base64
-from xos.config import Config
 from synchronizers.openstack.openstacksyncstep import OpenStackSyncStep
 from synchronizers.new_base.syncstep import *
 from synchronizers.new_base.ansible_helper import *
diff --git a/xos/synchronizer/steps/sync_images.py b/xos/synchronizer/steps/sync_images.py
index 61e8f18..b3994dd 100644
--- a/xos/synchronizer/steps/sync_images.py
+++ b/xos/synchronizer/steps/sync_images.py
@@ -1,6 +1,5 @@
 import os
 import base64
-from xos.config import Config
 from synchronizers.openstack.openstacksyncstep import OpenStackSyncStep
 from xos.logger import observer_logger as logger
 from synchronizers.new_base.modelaccessor import *
diff --git a/xos/synchronizer/steps/sync_instances.py b/xos/synchronizer/steps/sync_instances.py
index 640c712..13e023c 100644
--- a/xos/synchronizer/steps/sync_instances.py
+++ b/xos/synchronizer/steps/sync_instances.py
@@ -1,33 +1,35 @@
 import os
 import base64
 import socket
-from xos.config import Config
 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 *
 
-RESTAPI_HOSTNAME = getattr(Config(), "server_restapi_hostname", getattr(Config(), "server_hostname", socket.gethostname()))
-RESTAPI_PORT = int(getattr(Config(), "server_restapi_port", getattr(Config(), "server_port", "8000")))
+RESTAPI_HOSTNAME = socket.gethostname()
+RESTAPI_PORT = "8000"
+
 
 def escape(s):
-    s = s.replace('\n',r'\n').replace('"',r'\"')
+    s = s.replace('\n', r'\n').replace('"', r'\"')
     return s
 
+
 class SyncInstances(OpenStackSyncStep):
-    provides=[Instance]
-    requested_interval=0
-    observes=Instance
-    playbook='sync_instances.yaml'
+    provides = [Instance]
+    requested_interval = 0
+    observes = Instance
+    playbook = 'sync_instances.yaml'
 
     def fetch_pending(self, deletion=False):
         objs = super(SyncInstances, self).fetch_pending(deletion)
-        objs = [x for x in objs if x.isolation=="vm"]
+        objs = [x for x in objs if x.isolation == "vm"]
         return objs
 
     def get_userdata(self, instance, pubkeys):
-        userdata = '#cloud-config\n\nopencloud:\n   slicename: "%s"\n   hostname: "%s"\n   restapi_hostname: "%s"\n   restapi_port: "%s"\n' % (instance.slice.name, instance.node.name, RESTAPI_HOSTNAME, str(RESTAPI_PORT))
+        userdata = '#cloud-config\n\nopencloud:\n   slicename: "%s"\n   hostname: "%s"\n   restapi_hostname: "%s"\n   restapi_port: "%s"\n' % (
+        instance.slice.name, instance.node.name, RESTAPI_HOSTNAME, str(RESTAPI_PORT))
         userdata += 'ssh_authorized_keys:\n'
         for key in pubkeys:
             userdata += '  - %s\n' % key
@@ -36,7 +38,7 @@
     def get_nic_for_first_slot(self, nics):
         # Try to find a NIC with "public" visibility
         for nic in nics[:]:
-            network=nic.get("network", None)
+            network = nic.get("network", None)
             if network:
                 tem = network.template
                 if (tem.visibility == "public"):
@@ -44,11 +46,11 @@
 
         # Otherwise try to find a private network
         for nic in nics[:]:
-            network=nic.get("network", None)
+            network = nic.get("network", None)
             if network:
                 tem = network.template
-                if (tem.visibility == "private") and (tem.translation=="none") and ("management" not in tem.name):
-                   return nic
+                if (tem.visibility == "private") and (tem.translation == "none") and ("management" not in tem.name):
+                    return nic
 
         raise Exception("Could not find a NIC for first slot")
 
@@ -69,13 +71,13 @@
 
         # move the management network to the second spot
         for nic in nics[:]:
-            network=nic.get("network", None)
+            network = nic.get("network", None)
             if network:
                 tem = network.template
-                if (tem.visibility == "private") and (tem.translation=="none") and ("management" in tem.name):
-#MCORD
-#                    if len(result)!=1:
-#                        raise Exception("Management network needs to be inserted in slot 1, but there are %d private nics" % len(result))
+                if (tem.visibility == "private") and (tem.translation == "none") and ("management" in tem.name):
+                    # MCORD
+                    #                    if len(result)!=1:
+                    #                        raise Exception("Management network needs to be inserted in slot 1, but there are %d private nics" % len(result))
                     result.append(nic)
                     nics.remove(nic)
 
@@ -88,24 +90,26 @@
 
         # sanity check - make sure model_policy for slice has run
         if ((not instance.slice.policed) or (instance.slice.policed < instance.slice.updated)):
-            raise DeferredException("Instance %s waiting on Slice %s to execute model policies" % (instance, instance.slice.name))
+            raise DeferredException(
+                "Instance %s waiting on Slice %s to execute model policies" % (instance, instance.slice.name))
 
         # sanity check - make sure model_policy for all slice networks have run
         for network in instance.slice.ownedNetworks.all():
             if ((not network.policed) or (network.policed < network.updated)):
-                raise DeferredException("Instance %s waiting on Network %s to execute model policies" % (instance, network.name))
+                raise DeferredException(
+                    "Instance %s waiting on Network %s to execute model policies" % (instance, network.name))
 
         inputs = {}
-	metadata_update = {}
+        metadata_update = {}
         if (instance.numberCores):
             metadata_update["cpu_cores"] = str(instance.numberCores)
 
-# not supported by API... assuming it's not used ... look into enabling later
-#        for tag in instance.slice.tags.all():
-#            if tag.name.startswith("sysctl-"):
-#                metadata_update[tag.name] = tag.value
+        # not supported by API... assuming it's not used ... look into enabling later
+        #        for tag in instance.slice.tags.all():
+        #            if tag.name.startswith("sysctl-"):
+        #                metadata_update[tag.name] = tag.value
 
-	slice_memberships = SlicePrivilege.objects.filter(slice_id=instance.slice.id)
+        slice_memberships = SlicePrivilege.objects.filter(slice_id=instance.slice.id)
         pubkeys = set([sm.user.public_key for sm in slice_memberships if sm.user.public_key])
         if instance.creator.public_key:
             pubkeys.add(instance.creator.public_key)
@@ -116,10 +120,10 @@
         if instance.slice.service and instance.slice.service.public_key:
             pubkeys.add(instance.slice.service.public_key)
 
-        nics=[]
+        nics = []
 
         # handle ports the were created by the user
-        port_ids=[]
+        port_ids = []
         for port in Port.objects.filter(instance_id=instance.id):
             if not port.port_id:
                 raise DeferredException("Instance %s waiting on port %s" % (instance, port))
@@ -129,22 +133,26 @@
         existing_port_networks = [port.network for port in Port.objects.filter(instance_id=instance.id)]
         existing_port_network_ids = [x.id for x in existing_port_networks]
 
-        networks = [ns.network for ns in NetworkSlice.objects.filter(slice_id=instance.slice.id) if ns.network.id not in existing_port_network_ids]
+        networks = [ns.network for ns in NetworkSlice.objects.filter(slice_id=instance.slice.id) if
+                    ns.network.id not in existing_port_network_ids]
         networks_ids = [x.id for x in networks]
-        controller_networks = ControllerNetwork.objects.filter(controller_id=instance.node.site_deployment.controller.id)
+        controller_networks = ControllerNetwork.objects.filter(
+            controller_id=instance.node.site_deployment.controller.id)
         controller_networks = [x for x in controller_networks if x.id in networks_ids]
 
-
         for network in networks:
-           if not ControllerNetwork.objects.filter(network_id=network.id, controller_id=instance.node.site_deployment.controller.id).exists():
-              raise DeferredException("Instance %s Private Network %s lacks ControllerNetwork object" % (instance, network.name))
+            if not ControllerNetwork.objects.filter(network_id=network.id,
+                                                    controller_id=instance.node.site_deployment.controller.id).exists():
+                raise DeferredException(
+                    "Instance %s Private Network %s lacks ControllerNetwork object" % (instance, network.name))
 
         for controller_network in controller_networks:
             # Lenient exception - causes slow backoff
             if controller_network.network.template.translation == 'none':
-                   if not controller_network.net_id:
-                        raise DeferredException("Instance %s Private Network %s has no id; Try again later" % (instance, controller_network.network.name))
-                   nics.append({"kind": "net", "value": controller_network.net_id, "network": controller_network.network})
+                if not controller_network.net_id:
+                    raise DeferredException("Instance %s Private Network %s has no id; Try again later" % (
+                    instance, controller_network.network.name))
+                nics.append({"kind": "net", "value": controller_network.net_id, "network": controller_network.network})
 
         # now include network template
         network_templates = [network.template.shared_network_name for network in networks \
@@ -158,14 +166,15 @@
 
         if (not nics):
             for net in nets:
-                if net['name']=='public':
+                if net['name'] == 'public':
                     nics.append({"kind": "net", "value": net['id'], "network": None})
 
         nics = self.sort_nics(nics)
 
         image_name = None
         controller_images = instance.image.controllerimages.all()
-        controller_images = [x for x in controller_images if x.controller_id==instance.node.site_deployment.controller.id]
+        controller_images = [x for x in controller_images if
+                             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))
@@ -178,18 +187,10 @@
                     image_name = image.name
                     logger.info("using image from glance: " + str(image_name))
 
-	try:
-            legacy = Config().observer_legacy
-        except:
-            legacy = False
+        host_filter = instance.node.name.strip()
 
-        if (legacy):
-            host_filter = instance.node.name.split('.',1)[0]
-        else:
-            host_filter = instance.node.name.strip()
-
-        availability_zone_filter = 'nova:%s'%host_filter
-        instance_name = '%s-%d'%(instance.slice.name,instance.id)
+        availability_zone_filter = 'nova:%s' % host_filter
+        instance_name = '%s-%d' % (instance.slice.name, instance.id)
         self.instance_name = instance_name
 
         userData = self.get_userdata(instance, pubkeys)
@@ -200,30 +201,29 @@
         sanitized_nics = [{"kind": nic["kind"], "value": nic["value"]} for nic in nics]
 
         controller = instance.node.site_deployment.controller
-        fields = {'endpoint':controller.auth_url,
-                     'endpoint_v3': controller.auth_url_v3,
-                     'domain': controller.domain,
-                     'admin_user': instance.creator.email,
-                     'admin_password': instance.creator.remote_password,
-                     'project_name': instance.slice.name,
-                     'tenant': instance.slice.name,
-                     'tenant_description': instance.slice.description,
-                     'name':instance_name,
-                     'ansible_tag':instance_name,
-                     'availability_zone': availability_zone_filter,
-                     'image_name':image_name,
-                     'flavor_name':instance.flavor.name,
-                     'nics':sanitized_nics,
-                     'meta':metadata_update,
-                     'user_data':r'%s'%escape(userData)}
+        fields = {'endpoint': controller.auth_url,
+                  'endpoint_v3': controller.auth_url_v3,
+                  'domain': controller.domain,
+                  'admin_user': instance.creator.email,
+                  'admin_password': instance.creator.remote_password,
+                  'project_name': instance.slice.name,
+                  'tenant': instance.slice.name,
+                  'tenant_description': instance.slice.description,
+                  'name': instance_name,
+                  'ansible_tag': instance_name,
+                  'availability_zone': availability_zone_filter,
+                  'image_name': image_name,
+                  'flavor_name': instance.flavor.name,
+                  'nics': sanitized_nics,
+                  'meta': metadata_update,
+                  'user_data': r'%s' % escape(userData)}
         return fields
 
-
     def map_sync_outputs(self, instance, res):
-	instance_id = res[0]['openstack']['OS-EXT-SRV-ATTR:instance_name']
+        instance_id = res[0]['openstack']['OS-EXT-SRV-ATTR:instance_name']
         instance_uuid = res[0]['id']
 
-	try:
+        try:
             hostname = res[0]['openstack']['OS-EXT-SRV-ATTR:hypervisor_hostname']
             ip = socket.gethostbyname(hostname)
             instance.ip = ip
@@ -234,23 +234,22 @@
         instance.instance_uuid = instance_uuid
         instance.instance_name = self.instance_name
         instance.save()
-	
-	
+
     def map_delete_inputs(self, instance):
         controller_register = json.loads(instance.node.site_deployment.controller.backend_register)
 
-        if (controller_register.get('disabled',False)):
-            raise InnocuousException('Controller %s is disabled'%instance.node.site_deployment.controller.name)
+        if (controller_register.get('disabled', False)):
+            raise InnocuousException('Controller %s is disabled' % instance.node.site_deployment.controller.name)
 
-        instance_name = '%s-%d'%(instance.slice.name,instance.id)
+        instance_name = '%s-%d' % (instance.slice.name, instance.id)
         controller = instance.node.site_deployment.controller
-        input = {'endpoint':controller.auth_url,
-                     'admin_user': instance.creator.email,
-                     'admin_password': instance.creator.remote_password,
-                     'project_name': instance.slice.name,
-                     'tenant': instance.slice.name,
-                     'tenant_description': instance.slice.description,
-                     'name':instance_name,
-                     'ansible_tag':instance_name,
-                     'delete': True}
+        input = {'endpoint': controller.auth_url,
+                 'admin_user': instance.creator.email,
+                 'admin_password': instance.creator.remote_password,
+                 'project_name': instance.slice.name,
+                 'tenant': instance.slice.name,
+                 'tenant_description': instance.slice.description,
+                 'name': instance_name,
+                 'ansible_tag': instance_name,
+                 'delete': True}
         return input
diff --git a/xos/synchronizer/steps/sync_ports.py b/xos/synchronizer/steps/sync_ports.py
index cfd697f..f8a9d0b 100644
--- a/xos/synchronizer/steps/sync_ports.py
+++ b/xos/synchronizer/steps/sync_ports.py
@@ -1,6 +1,5 @@
 import os
 import base64
-from xos.config import Config
 from synchronizers.openstack.openstacksyncstep import OpenStackSyncStep
 from xos.logger import observer_logger as logger
 from synchronizers.new_base.modelaccessor import *
diff --git a/xos/synchronizer/steps/sync_roles.py b/xos/synchronizer/steps/sync_roles.py
index c202f74..8267f4b 100644
--- a/xos/synchronizer/steps/sync_roles.py
+++ b/xos/synchronizer/steps/sync_roles.py
@@ -1,6 +1,5 @@
 import os
 import base64
-from xos.config import Config
 from synchronizers.openstack.openstacksyncstep import OpenStackSyncStep
 from xos.logger import observer_logger as logger
 from synchronizers.new_base.modelaccessor import *
diff --git a/xos/synchronizer/xos-synchronizer.py b/xos/synchronizer/xos-synchronizer.py
deleted file mode 100644
index 6cd8e7a..0000000
--- a/xos/synchronizer/xos-synchronizer.py
+++ /dev/null
@@ -1,86 +0,0 @@
-#!/usr/bin/env python
-import os
-import argparse
-import sys
-
-sys.path.append('/opt/xos')
-
-os.environ.setdefault("DJANGO_SETTINGS_MODULE", "xos.settings")
-from xos.config import Config, DEFAULT_CONFIG_FN
-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
-
-config = Config()
-
-logger = Logger(level=logging.INFO)
-
-# TODO: These two lines are the only difference between this file and
-#       new_base/xos-synchronizer.py. Reconcile these.
-# set the driver.
-from synchronizers.openstack.driver import OpenStackDriver
-set_driver(OpenStackDriver())
-
-# after http://www.erlenstar.demon.co.uk/unix/faq_2.html
-def daemon():
-    """Daemonize the current process."""
-    if os.fork() != 0: os._exit(0)
-    os.setsid()
-    if os.fork() != 0: os._exit(0)
-    os.umask(0)
-    devnull = os.open(os.devnull, os.O_RDWR)
-    os.dup2(devnull, 0)
-    # xxx fixme - this is just to make sure that nothing gets stupidly lost - should use devnull
-    logdir=os.path.dirname(config.observer_logfile)
-    # when installed in standalone we might not have httpd installed
-    if not os.path.isdir(logdir): os.mkdir(logdir)
-    crashlog = os.open('%s'%config.observer_logfile, os.O_RDWR | os.O_APPEND | os.O_CREAT, 0644)
-    os.dup2(crashlog, 1)
-    os.dup2(crashlog, 2)
-
-    if hasattr(config, "observer_pidfile"):
-        pidfile = config.get("observer_pidfile")
-    else:
-        pidfile = "/var/run/xosobserver.pid"
-    try:
-        file(pidfile,"w").write(str(os.getpid()))
-    except:
-        print "failed to create pidfile %s" % pidfile
-
-def main():
-    # Generate command line parser
-    parser = argparse.ArgumentParser(usage='%(prog)s [options]')
-    parser.add_argument('-d', '--daemon', dest='daemon', action='store_true', default=False,
-                        help='Run as daemon.')
-    # smbaker: util/config.py parses sys.argv[] directly to get config file name; include the option here to avoid
-    #   throwing unrecognized argument exceptions
-    parser.add_argument('-C', '--config', dest='config_file', action='store', default=DEFAULT_CONFIG_FN,
-                        help='Name of config file.')
-    args = parser.parse_args()
-
-    if args.daemon: daemon()
-
-    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__':
-    
-    main() 
