diff --git a/xos/openstack_xos/client.py b/xos/openstack_xos/client.py
index fabf739..6ec7bc2 100644
--- a/xos/openstack_xos/client.py
+++ b/xos/openstack_xos/client.py
@@ -3,8 +3,8 @@
     from keystoneclient.v2_0 import client as keystone_client
     #from glance import client as glance_client
     import glanceclient
-     from novaclient.v2 import client as nova_client
-    from neutronclient import client as quantum_client
+    from novaclient.v2 import client as nova_client
+    from neutronclient.v2_0 import client as neutron_client 
     has_openstack = True
 except:
     has_openstack = False
@@ -154,11 +154,11 @@
     def __getattr__(self, name):
         return getattr(self.client, name)
 
-class QuantumClient(Client):
+class NeutronClient(Client):
     def __init__(self, *args, **kwds):
         Client.__init__(self, *args, **kwds)
         if has_openstack:
-            self.client = quantum_client.Client(username=self.username,
+            self.client = neutron_client.Client(username=self.username,
                                                 password=self.password,
                                                 tenant_name=self.tenant,
                                                 auth_url=self.url,
@@ -188,7 +188,7 @@
         self.glanceclient = GlanceClient('1', endpoint=glance_endpoint, token=token.id, **kwds)
         self.nova = NovaClient(*args, **kwds)
         # self.nova_db = NovaDB(*args, **kwds)
-        self.quantum = QuantumClient(*args, **kwds)
+        self.neutron = NeutronClient(*args, **kwds)
     
 
     @require_enabled
diff --git a/xos/openstack_xos/driver.py b/xos/openstack_xos/driver.py
index 5b1040e..a5a27ee 100644
--- a/xos/openstack_xos/driver.py
+++ b/xos/openstack_xos/driver.py
@@ -181,53 +181,53 @@
         return 1 
 
     def create_router(self, name, set_gateway=True):
-        routers = self.shell.quantum.list_routers(name=name)['routers']
+        routers = self.shell.neutron.list_routers(name=name)['routers']
         if routers:
             router = routers[0]
         else:
-            router = self.shell.quantum.create_router({'router': {'name': name}})['router']
+            router = self.shell.neutron.create_router({'router': {'name': name}})['router']
         # add router to external network
         if set_gateway:
-            nets = self.shell.quantum.list_networks()['networks']
+            nets = self.shell.neutron.list_networks()['networks']
             for net in nets:
                 if net['router:external'] == True: 
-                    self.shell.quantum.add_gateway_router(router['id'],
+                    self.shell.neutron.add_gateway_router(router['id'],
                                                           {'network_id': net['id']})
         
         return router
 
     def delete_router(self, id):
-        routers = self.shell.quantum.list_routers(id=id)['routers']
+        routers = self.shell.neutron.list_routers(id=id)['routers']
         for router in routers:
-            self.shell.quantum.delete_router(router['id'])
+            self.shell.neutron.delete_router(router['id'])
             # remove router form external network
-            #nets = self.shell.quantum.list_networks()['networks']
+            #nets = self.shell.neutron.list_networks()['networks']
             #for net in nets:
             #    if net['router:external'] == True:
-            #        self.shell.quantum.remove_gateway_router(router['id'])
+            #        self.shell.neutron.remove_gateway_router(router['id'])
 
     def add_router_interface(self, router_id, subnet_id):
-        router = self.shell.quantum.show_router(router_id)['router']
-        subnet = self.shell.quantum.show_subnet(subnet_id)['subnet']
+        router = self.shell.neutron.show_router(router_id)['router']
+        subnet = self.shell.neutron.show_subnet(subnet_id)['subnet']
         if router and subnet:
-            self.shell.quantum.add_interface_router(router_id, {'subnet_id': subnet_id})
+            self.shell.neutron.add_interface_router(router_id, {'subnet_id': subnet_id})
 
     def delete_router_interface(self, router_id, subnet_id):
-        router = self.shell.quantum.show_router(router_id)
-        subnet = self.shell.quantum.show_subnet(subnet_id)
+        router = self.shell.neutron.show_router(router_id)
+        subnet = self.shell.neutron.show_subnet(subnet_id)
         if router and subnet:
-            self.shell.quantum.remove_interface_router(router_id, {'subnet_id': subnet_id})
+            self.shell.neutron.remove_interface_router(router_id, {'subnet_id': subnet_id})
  
     def create_network(self, name, shared=False):
-        nets = self.shell.quantum.list_networks(name=name)['networks']
+        nets = self.shell.neutron.list_networks(name=name)['networks']
         if nets: 
             net = nets[0]
         else:
-            net = self.shell.quantum.create_network({'network': {'name': name, 'shared': shared}})['network']
+            net = self.shell.neutron.create_network({'network': {'name': name, 'shared': shared}})['network']
         return net
  
     def delete_network(self, id):
-        nets = self.shell.quantum.list_networks()['networks']
+        nets = self.shell.neutron.list_networks()['networks']
         for net in nets:
             if net['id'] == id:
                 # delete_all ports
@@ -235,18 +235,18 @@
                 # delete all subnets:
                 for subnet_id in net['subnets']:
                     self.delete_subnet(subnet_id)
-                self.shell.quantum.delete_network(net['id'])
+                self.shell.neutron.delete_network(net['id'])
         return 1
 
     def delete_network_ports(self, network_id):
-        ports = self.shell.quantum.list_ports()['ports']
+        ports = self.shell.neutron.list_ports()['ports']
         for port in ports:
             if port['network_id'] == network_id:
-                self.shell.quantum.delete_port(port['id'])
+                self.shell.neutron.delete_port(port['id'])
         return 1         
 
     def delete_subnet_ports(self, subnet_id):
-        ports = self.shell.quantum.list_ports()['ports']
+        ports = self.shell.neutron.list_ports()['ports']
         for port in ports:
             delete = False
             for fixed_ip in port['fixed_ips']:
@@ -254,17 +254,17 @@
                     delete=True
                     break
             if delete:
-                self.shell.quantum.delete_port(port['id'])
+                self.shell.neutron.delete_port(port['id'])
         return 1
  
     def create_subnet(self, name, network_id, cidr_ip, ip_version, start, end):
-        #nets = self.shell.quantum.list_networks(name=network_name)['networks']
+        #nets = self.shell.neutron.list_networks(name=network_name)['networks']
         #if not nets:
         #    raise Exception, "No such network: %s" % network_name   
         #net = nets[0]
 
         subnet = None 
-        subnets = self.shell.quantum.list_subnets()['subnets']
+        subnets = self.shell.neutron.list_subnets()['subnets']
         for snet in subnets:
             if snet['cidr'] == cidr_ip and snet['network_id'] == network_id:
                 subnet = snet
@@ -282,22 +282,22 @@
                                  'host_routes': [{'destination':'169.254.169.254/32','nexthop':metadata_ip}],
                                  'gateway_ip': None,
                                  'allocation_pools': allocation_pools}}
-            subnet = self.shell.quantum.create_subnet(subnet)['subnet']
+            subnet = self.shell.neutron.create_subnet(subnet)['subnet']
             # self.add_external_route(subnet)
 
         return subnet
 
     def update_subnet(self, id, fields):
-        return self.shell.quantum.update_subnet(id, fields)
+        return self.shell.neutron.update_subnet(id, fields)
 
     def delete_subnet(self, id):
-        #return self.shell.quantum.delete_subnet(id=id)
+        #return self.shell.neutron.delete_subnet(id=id)
         # inefficient but fault tolerant
-        subnets = self.shell.quantum.list_subnets()['subnets']
+        subnets = self.shell.neutron.list_subnets()['subnets']
         for subnet in subnets:
             if subnet['id'] == id:
                 self.delete_subnet_ports(subnet['id'])
-                self.shell.quantum.delete_subnet(id)
+                self.shell.neutron.delete_subnet(id)
                 self.delete_external_route(subnet)
         return 1
 
@@ -310,7 +310,7 @@
         if not routes:
             routes = self.get_external_routes()
  
-        ports = self.shell.quantum.list_ports()['ports']
+        ports = self.shell.neutron.list_ports()['ports']
 
         gw_ip = subnet['gateway_ip']
         subnet_id = subnet['id']
@@ -325,7 +325,7 @@
                 if fixed_ip['subnet_id'] == subnet_id and fixed_ip['ip_address'] == gw_ip:
                     gw_port = port
                     router_id = gw_port['device_id']
-                    router = self.shell.quantum.show_router(router_id)['router']
+                    router = self.shell.neutron.show_router(router_id)['router']
                     if router and router.get('external_gateway_info'):
                         ext_net = router['external_gateway_info']['network_id']
                         for port in ports:
@@ -347,7 +347,7 @@
         return 1
 
     def delete_external_route(self, subnet):
-        ports = self.shell.quantum.list_ports()['ports']
+        ports = self.shell.neutron.list_ports()['ports']
 
         gw_ip = subnet['gateway_ip']
         subnet_id = subnet['id']
@@ -362,7 +362,7 @@
                 if fixed_ip['subnet_id'] == subnet_id and fixed_ip['ip_address'] == gw_ip:
                     gw_port = port
                     router_id = gw_port['device_id']
-                    router = self.shell.quantum.show_router(router_id)['router']
+                    router = self.shell.neutron.show_router(router_id)['router']
                     ext_net = router['external_gateway_info']['network_id']
                     for port in ports:
                         if port['device_id'] == router_id and port['network_id'] == ext_net:
@@ -397,24 +397,24 @@
             tenant = self.shell.nova.tenant
         tenant = self.shell.keystone.tenants.find(name=tenant)
         search_opts = {"tenant_id": tenant.id, "shared": False}
-        private_networks = self.shell.quantum.list_networks(**search_opts)
+        private_networks = self.shell.neutron.list_networks(**search_opts)
         return private_networks
 
     def get_shared_networks(self):
         search_opts = {"shared": True}
-        shared_networks = self.shell.quantum.list_networks(**search_opts)
+        shared_networks = self.shell.neutron.list_networks(**search_opts)
         return shared_networks
 
     def get_network_subnet(self, network_id):
         subnet_id = None
         subnet = None
         if network_id:
-            os_networks = self.shell.quantum.list_networks(id=network_id)["networks"]
+            os_networks = self.shell.neutron.list_networks(id=network_id)["networks"]
             if os_networks:
                 os_network = os_networks[0]
                 if os_network['subnets']:
                     subnet_id = os_network['subnets'][0]
-                    os_subnets = self.shell.quantum.list_subnets(id=subnet_id)['subnets']
+                    os_subnets = self.shell.neutron.list_subnets(id=subnet_id)['subnets']
                     if os_subnets:
                         subnet = os_subnets[0]['cidr']
 
diff --git a/xos/openstack_xos/manager.py b/xos/openstack_xos/manager.py
index ae288bd..50b3fd4 100644
--- a/xos/openstack_xos/manager.py
+++ b/xos/openstack_xos/manager.py
@@ -239,7 +239,7 @@
         self.driver.delete_tenant(slice.tenant_id)
         # delete external route
         subnet = None
-        subnets = self.driver.shell.quantum.list_subnets()['subnets']
+        subnets = self.driver.shell.neutron.list_subnets()['subnets']
         for snet in subnets:
             if snet['id'] == slice.subnet_id:
                 subnet = snet
@@ -268,7 +268,7 @@
     def get_next_subnet(self):
         # limit ourself to 10.0.x.x for now
         valid_subnet = lambda net: net.startswith('10.0')  
-        subnets = self.driver.shell.quantum.list_subnets()['subnets']
+        subnets = self.driver.shell.neutron.list_subnets()['subnets']
         ints = [int(IPNetwork(subnet['cidr']).ip) for subnet in subnets \
                 if valid_subnet(subnet['cidr'])] 
         ints.sort()
@@ -280,13 +280,13 @@
     @require_enabled
     def save_subnet(self, subnet):    
         if not subnet.subnet_id:
-            quantum_subnet = self.driver.create_subnet(name= subnet.slice.name,
+            neutron_subnet = self.driver.create_subnet(name= subnet.slice.name,
                                           network_id=subnet.slice.network_id,
                                           cidr_ip = subnet.cidr,
                                           ip_version=subnet.ip_version,
                                           start = subnet.start,
                                           end = subnet.end)
-            subnet.subnet_id = quantum_subnet['id']
+            subnet.subnet_id = neutron_subnet['id']
             # add subnet as interface to slice's router
             self.driver.add_router_interface(subnet.slice.router_id, subnet.subnet_id)
             #add_route = 'route add -net %s dev br-ex gw 10.100.0.5' % self.cidr
@@ -472,7 +472,7 @@
 
     def save_network_template(self, template):
         if (template.shared_network_name) and (not template.shared_network_id):
-            os_networks = self.driver.shell.quantum.list_networks(name=template.shared_network_name)['networks']
+            os_networks = self.driver.shell.neutron.list_networks(name=template.shared_network_name)['networks']
             if os_networks:
                 template.shared_network_id = os_networks[0]["id"]
 
@@ -521,7 +521,7 @@
 
         # Get a list of all shared networks in OS
 
-        os_networks = self.driver.shell.quantum.list_networks()['networks']
+        os_networks = self.driver.shell.neutron.list_networks()['networks']
         os_networks_by_name = {}
         os_networks_by_id = {}
         for os_network in os_networks:
diff --git a/xos/synchronizers/base/steps/sync_instances.py b/xos/synchronizers/base/steps/sync_instances.py
index 335ca4a..2862474 100644
--- a/xos/synchronizers/base/steps/sync_instances.py
+++ b/xos/synchronizers/base/steps/sync_instances.py
@@ -75,7 +75,7 @@
 
         #driver = self.driver.client_driver(caller=instance.creator, tenant=instance.slice.name, controller=instance.controllerNetwork)
         driver = self.driver.admin_driver(tenant='admin', controller=instance.node.site_deployment.controller)
-        nets = driver.shell.quantum.list_networks()['networks']
+        nets = driver.shell.neutron.list_networks()['networks']
         for net in nets:
             if net['name'] in network_templates:
                 nics.append(net['id'])
diff --git a/xos/synchronizers/base/steps/sync_ports.py b/xos/synchronizers/base/steps/sync_ports.py
index 4c6681f..8f2b66d 100644
--- a/xos/synchronizers/base/steps/sync_ports.py
+++ b/xos/synchronizers/base/steps/sync_ports.py
@@ -12,7 +12,7 @@
     provides=[Port]
     observes=Port
 
-    #     The way it works is to enumerate the all of the ports that quantum
+    #     The way it works is to enumerate the all of the ports that neutron
     #     has, and then work backward from each port's network-id to determine
     #     which Network is associated from the port.
 
@@ -51,7 +51,7 @@
                 continue
             try:
                 driver = self.driver.admin_driver(controller = controller)
-                ports = driver.shell.quantum.list_ports()["ports"]
+                ports = driver.shell.neutron.list_ports()["ports"]
             except:
                 logger.log_exc("failed to get ports from controller %s" % controller)
                 continue
@@ -63,7 +63,7 @@
             # in the data model, so build up a list of which ids map to which network
             # templates.
             try:
-                neutron_networks = driver.shell.quantum.list_networks()["networks"]
+                neutron_networks = driver.shell.neutron.list_networks()["networks"]
             except:
                 print "failed to get networks from controller %s" % controller
                 continue
@@ -109,7 +109,7 @@
 
             if network.template.shared_network_name:
                 # If it's a shared network template, then more than one network
-                # object maps to the quantum network. We have to do a whole bunch
+                # object maps to the neutron network. We have to do a whole bunch
                 # of extra work to find the right one.
                 networks = network.template.network_set.all()
                 network = None
@@ -180,7 +180,7 @@
                     client = OpenStackClient(controller=controller, **auth) # cacert=self.config.nova_ca_ssl_cert,
                     driver = OpenStackDriver(client=client)
 
-                    neutron_port = driver.shell.quantum.create_port({"port": {"network_id": cn.net_id}})["port"]
+                    neutron_port = driver.shell.neutron.create_port({"port": {"network_id": cn.net_id}})["port"]
                     port.port_id = neutron_port["id"]
                     if neutron_port["fixed_ips"]:
                         port.ip = neutron_port["fixed_ips"][0]["ip_address"]
diff --git a/xos/synchronizers/openstack/steps/sync_instances.py b/xos/synchronizers/openstack/steps/sync_instances.py
index e1561b5..7bd01c3 100644
--- a/xos/synchronizers/openstack/steps/sync_instances.py
+++ b/xos/synchronizers/openstack/steps/sync_instances.py
@@ -118,7 +118,7 @@
 
         #driver = self.driver.client_driver(caller=instance.creator, tenant=instance.slice.name, controller=instance.controllerNetwork)
         driver = self.driver.admin_driver(tenant='admin', controller=instance.node.site_deployment.controller)
-        nets = driver.shell.quantum.list_networks()['networks']
+        nets = driver.shell.neutron.list_networks()['networks']
         for net in nets:
             if net['name'] in network_templates:
                 nics.append({"kind": "net", "value": net['id'], "network": None})
diff --git a/xos/synchronizers/openstack/steps/sync_ports.py b/xos/synchronizers/openstack/steps/sync_ports.py
index 1aeaef3..afb8321 100644
--- a/xos/synchronizers/openstack/steps/sync_ports.py
+++ b/xos/synchronizers/openstack/steps/sync_ports.py
@@ -12,7 +12,7 @@
     provides=[Port]
     observes=Port
 
-    #     The way it works is to enumerate the all of the ports that quantum
+    #     The way it works is to enumerate the all of the ports that neutron
     #     has, and then work backward from each port's network-id to determine
     #     which Network is associated from the port.
 
@@ -78,7 +78,7 @@
                 continue
             try:
                 driver = self.driver.admin_driver(controller = controller)
-                ports = driver.shell.quantum.list_ports()["ports"]
+                ports = driver.shell.neutron.list_ports()["ports"]
             except:
                 logger.log_exc("failed to get ports from controller %s" % controller)
                 continue
@@ -90,7 +90,7 @@
             # in the data model, so build up a list of which ids map to which network
             # templates.
             try:
-                neutron_networks = driver.shell.quantum.list_networks()["networks"]
+                neutron_networks = driver.shell.neutron.list_networks()["networks"]
             except:
                 print "failed to get networks from controller %s" % controller
                 continue
@@ -136,7 +136,7 @@
 
             if network.template.shared_network_name:
                 # If it's a shared network template, then more than one network
-                # object maps to the quantum network. We have to do a whole bunch
+                # object maps to the neutron network. We have to do a whole bunch
                 # of extra work to find the right one.
                 networks = network.template.network_set.all()
                 network = None
@@ -198,7 +198,7 @@
                     if neutron_port_name:
                         args["name"] = neutron_port_name
 
-                    neutron_port = driver.shell.quantum.create_port({"port": args})["port"]
+                    neutron_port = driver.shell.neutron.create_port({"port": args})["port"]
                     port.port_id = neutron_port["id"]
                     if neutron_port["fixed_ips"]:
                         port.ip = neutron_port["fixed_ips"][0]["ip_address"]
@@ -220,7 +220,7 @@
             logger.info("calling openstack to destroy port %s" % port.port_id)
             try:
                 driver = self.get_driver(port)
-                driver.shell.quantum.delete_port(port.port_id)
+                driver.shell.neutron.delete_port(port.port_id)
             except:
                 logger.log_exc("failed to delete port %s from neutron" % port.port_id)
                 return
diff --git a/xos/synchronizers/vtn/steps/sync_port_addresses.py b/xos/synchronizers/vtn/steps/sync_port_addresses.py
index bbc6c99..d662ff3 100644
--- a/xos/synchronizers/vtn/steps/sync_port_addresses.py
+++ b/xos/synchronizers/vtn/steps/sync_port_addresses.py
@@ -84,7 +84,7 @@
                 continue
             try:
                 driver = self.driver.admin_driver(controller = controller)
-                ports = driver.shell.quantum.list_ports()["ports"]
+                ports = driver.shell.neutron.list_ports()["ports"]
             except:
                 logger.log_exc("failed to get ports from controller %s" % controller)
                 continue
@@ -124,7 +124,7 @@
 
             if changed:
                 logger.info("updating port %s" % port)
-                driver.shell.quantum.update_port(port.port_id, {"port": {"allowed_address_pairs": aaps}})
+                driver.shell.neutron.update_port(port.port_id, {"port": {"allowed_address_pairs": aaps}})
 
 
 
