diff --git a/planetstack/ec2_observer/event_loop.py b/planetstack/ec2_observer/event_loop.py
index 02725be..dd81e24 100644
--- a/planetstack/ec2_observer/event_loop.py
+++ b/planetstack/ec2_observer/event_loop.py
@@ -269,7 +269,7 @@
 							# Various checks that decide whether
 							# this step runs or not
 							self.check_class_dependency(sync_step, failed_steps) # dont run Slices if Sites failed
-							self.check_schedule(sync_step,deletion) # dont run sync_network_routes if time since last run < 1 hour
+							self.check_schedule(sync_step, deletion) # dont run sync_network_routes if time since last run < 1 hour
 							should_run = True
 						except StepNotReady:
 							logging.info('Step not ready: %s'%sync_step.__name__)
diff --git a/planetstack/ec2_observer/steps/sync_external_routes.py b/planetstack/ec2_observer/steps/sync_external_routes.py
deleted file mode 100644
index 1e1a347..0000000
--- a/planetstack/ec2_observer/steps/sync_external_routes.py
+++ /dev/null
@@ -1,18 +0,0 @@
-import os
-import base64
-from planetstack.config import Config
-from observer.syncstep import SyncStep
-
-class SyncExternalRoutes(SyncStep):
-    # XXX what does this provide?
-    provides=[]
-    requested_interval = 86400 # This step is slow like a pig. Let's run it infrequently
-
-    def call(self, **args):
-        routes = self.driver.get_external_routes()
-        subnets = self.driver.shell.quantum.list_subnets()['subnets']
-        for subnet in subnets:
-            try:
-                self.driver.add_external_route(subnet, routes)
-            except:
-                logger.log_exc("failed to add external route for subnet %s" % subnet)
diff --git a/planetstack/ec2_observer/steps/sync_mock_nodes.py b/planetstack/ec2_observer/steps/sync_mock_nodes.py
deleted file mode 100644
index 3cb3dd0..0000000
--- a/planetstack/ec2_observer/steps/sync_mock_nodes.py
+++ /dev/null
@@ -1,42 +0,0 @@
-import os
-import base64
-import random
-from datetime import datetime 
-from django.db.models import F, Q
-from planetstack.config import Config
-from observer.openstacksyncstep import OpenStackSyncStep
-from core.models.node import Node
-from core.models.deployment import Deployment
-from core.models.site import Site
-
-class SyncNodes(OpenStackSyncStep):
-    provides=[Node]
-    requested_interval=0
-
-    def fetch_pending(self):
-        # collect local nodes
-        sites = Site.objects.all()
-		one_and_only_deployment = Deployments.objects.all()
-
-        node_hostnames  = [node.name for node in nodes]
-
-		instance_types = 'm1.small | m1.medium | m1.large | m1.xlarge | m3.medium | m3.large | m3.xlarge | m3.2xlarge'.split(' | ')
-
-		all_new_nodes = []
-		for s in sites:
-			node_names = [n.name for n in s.nodes]
-			new_node_names = list(set(instance_types) - set(node_names))
-			new_nodes = []
-			for node_name in new_node_names:
-                node = Node(name=node_name,
-                            site=s, deployment=one_and_only_deployment)
-				new_nodes.append(node)
-
-			all_new_nodes.extend(new_nodes)
-
-		return all_new_nodes
-                 
-
-    def sync_record(self, node):
-        node.save()
-          
diff --git a/planetstack/ec2_observer/steps/sync_network_deployments.py b/planetstack/ec2_observer/steps/sync_network_deployments.py
deleted file mode 100644
index d1b51d5..0000000
--- a/planetstack/ec2_observer/steps/sync_network_deployments.py
+++ /dev/null
@@ -1,117 +0,0 @@
-import os
-import base64
-from collections import defaultdict
-from netaddr import IPAddress, IPNetwork
-from django.db.models import F, Q
-from planetstack.config import Config
-from observer.openstacksyncstep import OpenStackSyncStep
-from core.models.network import *
-from core.models.slice import *
-from core.models.slice import Sliver
-from util.logger import Logger, logging
-
-logger = Logger(level=logging.INFO)
-
-class SyncNetworkDeployments(OpenStackSyncStep):
-    requested_interval = 0 
-    provides=[Networ, NetworkDeployments, Sliver]
-    
-    def fetch_pending(self):
-        # network deployments are not visible to users. We must ensure
-        # networks are deployed at all deploymets available to their slices. 
-        slice_deployments = SliceDeployments.objects.all()
-        slice_deploy_lookup = defaultdict(list)
-        for slice_deployment in slice_deployments:
-            slice_deploy_lookup[slice_deployment.slice].append(slice_deployment.deployment)
-        
-        network_deployments = NetworkDeployments.objects.all()
-        network_deploy_lookup = defaultdict(list)
-        for network_deployment in network_deployments:
-            network_deploy_lookup[network_deployment.network].append(network_deployment.deployment)
-
-        for network in Network.objects.filter():
-            # ignore networks that have
-            # template.visibility = private and template.translation = none
-            if network.template.visibility == 'private' and not network.template.translation == 'none':
-                continue
-            expected_deployments = slice_deploy_lookup[network.owner]
-            for expected_deployment in expected_deployments:
-                if network not in network_deploy_lookup or \
-                  expected_deployment not in network_deploy_lookup[network]:
-                    nd = NetworkDeployments(network=network, deployment=expected_deployment)
-                    nd.save()
-        return NetworkDeployments.objects.filter(Q(enacted__lt=F('updated')) | Q(enacted=None))
-
-    def get_next_subnet(self, deployment=None):
-        # limit ourself to 10.0.x.x for now
-        valid_subnet = lambda net: net.startswith('10.0')
-        driver = self.driver.admin_driver(deployment=deployment)
-        subnets = driver.shell.quantum.list_subnets()['subnets']
-        ints = [int(IPNetwork(subnet['cidr']).ip) for subnet in subnets \
-                if valid_subnet(subnet['cidr'])]
-        ints.sort()
-        if ints:
-            last_ip = IPAddress(ints[-1])
-        else:
-            last_ip = IPAddress('10.0.0.0')
-        last_network = IPNetwork(str(last_ip) + "/24")
-        next_network = IPNetwork(str(IPAddress(last_network) + last_network.size) + "/24")
-        return next_network
-
-    def save_network_deployment(self, network_deployment):
-        if not network_deployment.network_id and network_deployment.network.template.sharedNetworkName:
-            network_deployment.network_id = network_deployment.network.template.sharedNetworkId
-
-        if not network_deployment.net_id:
-            network_name = network_deployment.network.name
-
-            # create network
-            os_network = self.driver.create_network(network_name, shared=True)
-            network_deployment.net_id = os_network['id']
-
-            # create router
-            #router = self.driver.create_router(network_name)
-            #network_deployment.router_id = router['id']
-
-            # create subnet
-            next_subnet = self.get_next_subnet(deployment=network_deployment.deployment.name)
-            cidr = str(next_subnet.cidr)
-            ip_version = next_subnet.version
-            start = str(next_subnet[2])
-            end = str(next_subnet[-2])
-            subnet = self.driver.create_subnet(name=network_name,
-                                               network_id = network_deployment.net_id,
-                                               cidr_ip = cidr,
-                                               ip_version = ip_version,
-                                               start = start,
-                                               end = end)
-            network_deployment.subnet = cidr
-            network_deployment.subnet_id = subnet['id']
-            # add subnet as interface to slice's router
-            #self.driver.add_router_interface(router['id'], subnet['id'])
-            # add external route
-            #self.driver.add_external_route(subnet)
-            logger.info("created private subnet (%s) for network: %s" % (cidr, network_deployment.network))
-        else:
-            (network_deployment.subnet_id, network_deployment.subnet) = self.driver.get_network_subnet(network_deployment.net_id)
-            logger.info("sync'ed subnet (%s) for network: %s" % (network_deployment.subnet, network_deployment.network))
-
-        network_deployment.save()
-
-    def sync_record(self, network_deployment):
-        if network_deployment.network.owner and network_deployment.network.owner.creator:
-            try:
-                # update manager context
-                real_driver = self.driver
-                self.driver = self.driver.client_driver(caller=network_deployment.network.owner.creator, 
-                                                        tenant=network_deployment.network.owner.name,
-                                                        deployment=network_deployment.deployment.name)
-                self.save_network_deployment(network_deployment)
-                self.driver = real_driver
-                logger.info("saved network deployment: %s" % (network_deployment))
-            except Exception,e:
-                logger.log_exc("save network deployment failed: %s" % network_deployment)
-                raise e            
-        
-          
-    
diff --git a/planetstack/ec2_observer/steps/sync_network_slivers.py b/planetstack/ec2_observer/steps/sync_network_slivers.py
deleted file mode 100644
index 7e69330..0000000
--- a/planetstack/ec2_observer/steps/sync_network_slivers.py
+++ /dev/null
@@ -1,80 +0,0 @@
-import os
-import base64
-from django.db.models import F, Q
-from planetstack.config import Config
-from observer.openstacksyncstep import OpenStackSyncStep
-from core.models.network import *
-
-class SyncNetworkSlivers(OpenStackSyncStep):
-    requested_interval = 3600
-    provides=[NetworkSliver]
-
-    def fetch_pending(self):
-        return NetworkSliver.objects.filter(Q(enacted__lt=F('updated')) | Q(enacted=None))
-
-    def call(self, failed=[]):
-        networkSlivers = NetworkSliver.objects.all()
-        networkSlivers_by_id = {}
-        networkSlivers_by_port = {}
-        for networkSliver in networkSlivers:
-            networkSlivers_by_id[networkSliver.id] = networkSliver
-            networkSlivers_by_port[networkSliver.port_id] = networkSliver
-
-        networks = Network.objects.all()
-        networks_by_id = {}
-        for network in networks:
-            networks_by_id[network.network_id] = network
-
-        slivers = Sliver.objects.all()
-        slivers_by_instance_id = {}
-        for sliver in slivers:
-            slivers_by_instance_id[sliver.instance_id] = sliver
-
-        driver = self.driver.admin_driver(caller=sliver.creator, tenant=sliver.slice.name, deployment=sliver.node.deployment.name)
-        ports = driver.shell.quantum.list_ports()["ports"]
-        for port in ports:
-            if port["id"] in networkSlivers_by_port:
-                # we already have it
-                print "already accounted for port", port["id"]
-                continue
-
-            if port["device_owner"] != "compute:nova":
-                # we only want the ports that connect to instances
-                continue
-
-            network = networks_by_id.get(port['network_id'], None)
-            if not network:
-                #print "no network for port", port["id"], "network", port["network_id"]
-                continue
-
-            sliver = slivers_by_instance_id.get(port['device_id'], None)
-            if not sliver:
-                print "no sliver for port", port["id"], "device_id", port['device_id']
-                continue
-
-            if network.template.sharedNetworkId is not None:
-                # 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
-                # of extra work to find the right one.
-                networks = network.template.network_set.all()
-                network = None
-                for candidate_network in networks:
-                    if (candidate_network.owner == sliver.slice):
-                        print "found network", candidate_network
-                        network = candidate_network
-
-                if not network:
-                    print "failed to find the correct network for a shared template for port", port["id"], "network", port["network_id"]
-                    continue
-
-            if not port["fixed_ips"]:
-                print "port", port["id"], "has no fixed_ips"
-                continue
-
-#             print "XXX", port
-
-            ns = NetworkSliver(network=network,
-                               sliver=sliver,
-                               ip=port["fixed_ips"][0]["ip_address"],
-                               port_id=port["id"])
-            ns.save()
diff --git a/planetstack/ec2_observer/steps/sync_networks.py b/planetstack/ec2_observer/steps/sync_networks.py
deleted file mode 100644
index cc277c6..0000000
--- a/planetstack/ec2_observer/steps/sync_networks.py
+++ /dev/null
@@ -1,20 +0,0 @@
-import os
-import base64
-from django.db.models import F, Q
-from planetstack.config import Config
-from observer.openstacksyncstep import OpenStackSyncStep
-from core.models.network import *
-from util.logger import Logger, logging
-
-logger = Logger(level=logging.INFO)
-
-class SyncNetworks(SyncStep):
-    provides=[Network]
-    requested_interval = 0
-
-    def fetch_pending(self):
-        return Network.objects.filter(Q(enacted__lt=F('updated')) | Q(enacted=None))
-
-    def sync_record(self, network):
-        network.save()
-
diff --git a/planetstack/ec2_observer/steps/sync_roles.py b/planetstack/ec2_observer/steps/sync_roles.py
deleted file mode 100644
index 5dc30d9..0000000
--- a/planetstack/ec2_observer/steps/sync_roles.py
+++ /dev/null
@@ -1,37 +0,0 @@
-import os
-import base64
-from django.db.models import F, Q
-from planetstack.config import Config
-from observer.openstacksyncstep import OpenStackSyncStep
-from core.models.role import Role
-from core.models.site import SiteRole
-from core.models.slice import SliceRole
-from core.models.deployment import DeploymentRole
-
-class SyncRoles(OpenStackSyncStep):
-    provides=[Role]
-    requested_interval=0
-
-    def fetch_pending(self):
-        site_roles = SiteRole.objects.filter(Q(enacted__lt=F('updated')) | Q(enacted=None))
-        slice_roles = SliceRole.objects.filter(Q(enacted__lt=F('updated')) | Q(enacted=None))
-        deployment_roles = DeploymentRole.objects.filter(Q(enacted__lt=F('updated')) | Q(enacted=None))
-
-        roles = []
-        for site_role in site_roles:
-            roles.append(site_role)
-        for slice_role in slice_roles:
-            roles.append(slice_role)
-        for deployment_role in deployment_roles:
-            roles.append(deployment_role)
-
-        return roles
-
-
-    def sync_record(self, role):
-        if not role.enacted:
-            deployments = Deployment.objects.all()
-            for deployment in deployments:
-                driver = self.driver.admin_driver(deployment=deployment.name)
-                driver.create_role(role.role)
-            role.save()    
diff --git a/planetstack/ec2_observer/steps/sync_site_privileges.py b/planetstack/ec2_observer/steps/sync_site_privileges.py
deleted file mode 100644
index b57ae43..0000000
--- a/planetstack/ec2_observer/steps/sync_site_privileges.py
+++ /dev/null
@@ -1,31 +0,0 @@
-import os
-import base64
-from django.db.models import F, Q
-from planetstack.config import Config
-from observer.openstacksyncstep import OpenStackSyncStep
-from core.models.site import *
-from core.models.user import User, UserDeployments    
-
-class SyncSitePrivileges(OpenStackSyncStep):
-    requested_interval=0
-    provides=[SitePrivilege]
-
-    def fetch_pending(self):
-        return SitePrivilege.objects.filter(Q(enacted__lt=F('updated')) | Q(enacted=None))
-
-    def sync_record(self, site_priv):
-        if site_priv.user.kuser_id and site_priv.site.tenant_id:
-            self.driver.add_user_role(site_priv.user.kuser_id,
-                                      site_priv.site.tenant_id,
-                                      site_priv.role.role) 
-
-        # sync site privileges at all site deployments
-        site_deployments = SiteDeployments.objects.filter(site=site_priv.site)
-        for site_deployment in site_deployments:
-            user_deployments = UserDeployments.objects.filter(deployment=site_deployment.deployment)
-            if user_deployments:
-                kuser_id  = user_deployments[0].kuser_id
-                driver = self.driver.admin_driver(deployment=site_deployment.deployment.name)
-                driver.add_user_role(kuser_id,
-                                     site_deployment.tenant_id,
-                                     site_priv.role.role)
diff --git a/planetstack/ec2_observer/steps/sync_slice_deployments.py b/planetstack/ec2_observer/steps/sync_slice_deployments.py
deleted file mode 100644
index 580edd1..0000000
--- a/planetstack/ec2_observer/steps/sync_slice_deployments.py
+++ /dev/null
@@ -1,107 +0,0 @@
-import os
-import base64
-from collections import defaultdict
-from netaddr import IPAddress, IPNetwork
-from django.db.models import F, Q
-from planetstack.config import Config
-from observer.openstacksyncstep import OpenStackSyncStep
-from core.models.deployment import Deployment
-from core.models.site import SiteDeployments
-from core.models.slice import Slice, SliceDeployments
-from core.models.user import UserDeployments
-from util.logger import Logger, logging
-
-logger = Logger(level=logging.INFO)
-
-class SyncSliceDeployments(OpenStackSyncStep):
-    provides=[SliceDeployments]
-    requested_interval=0
-
-    def fetch_pending(self):
-        # slice deployments are not visible to users. We must ensure
-        # slices are deployed at all deploymets available to their site.
-        site_deployments = SiteDeployments.objects.all()
-        site_deploy_lookup = defaultdict(list)
-        for site_deployment in site_deployments:
-            site_deploy_lookup[site_deployment.site].append(site_deployment.deployment)
-        
-        slice_deployments = SliceDeployments.objects.all()
-        slice_deploy_lookup = defaultdict(list)
-        for slice_deployment in slice_deployments:
-            slice_deploy_lookup[slice_deployment.slice].append(slice_deployment.deployment)
-        
-        all_deployments = Deployment.objects.all() 
-        for slice in Slice.objects.all():
-            # slices are added to all deployments for now
-            expected_deployments = all_deployments
-            #expected_deployments = site_deploy_lookup[slice.site]
-            for expected_deployment in expected_deployments:
-                if slice not in slice_deploy_lookup or \
-                   expected_deployment not in slice_deploy_lookup[slice]:
-                    sd = SliceDeployments(slice=slice, deployment=expected_deployment)
-                    sd.save()
-
-        # now we can return all slice deployments that need to be enacted   
-        return SliceDeployments.objects.filter(Q(enacted__lt=F('updated')) | Q(enacted=None))
-
-    def get_next_subnet(self, deployment=None):
-        # limit ourself to 10.0.x.x for now
-        valid_subnet = lambda net: net.startswith('10.0')
-        driver = self.driver.admin_driver(deployment=deployment)
-        subnets = driver.shell.quantum.list_subnets()['subnets']
-        ints = [int(IPNetwork(subnet['cidr']).ip) for subnet in subnets \
-                if valid_subnet(subnet['cidr'])]
-        ints.sort()
-        if ints:
-            last_ip = IPAddress(ints[-1])
-        else:
-            last_ip = IPAddress('10.0.0.1')
-        last_ip = IPAddress(ints[-1])
-        last_network = IPNetwork(str(last_ip) + "/24")
-        next_network = IPNetwork(str(IPAddress(last_network) + last_network.size) + "/24")
-        return next_network
-
-
-    def sync_record(self, slice_deployment):
-        logger.info("sync'ing slice deployment %s" % slice_deployment)
-        if not slice_deployment.tenant_id:
-            nova_fields = {'tenant_name': slice_deployment.slice.name,
-                   'description': slice_deployment.slice.description,
-                   'enabled': slice_deployment.slice.enabled}
-            driver = self.driver.admin_driver(deployment=slice_deployment.deployment.name)
-            tenant = driver.create_tenant(**nova_fields)
-            slice_deployment.tenant_id = tenant.id
-
-            # XXX give caller an admin role at the tenant they've created
-            deployment_users = UserDeployments.objects.filter(user=slice_deployment.slice.creator,
-                                                             deployment=slice_deployment.deployment)            
-            if not deployment_users:
-                logger.info("slice createor %s has not accout at deployment %s" % (slice_deployment.slice.creator, slice_deployment.deployment.name))
-            else:
-                deployment_user = deployment_users[0]
-                # lookup user id at this deployment
-                kuser= driver.shell.keystone.users.find(email=slice_deployment.slice.creator.email)
-
-                # add required roles at the slice's tenant 
-                driver.add_user_role(kuser.id, tenant.id, 'admin')
-                    
-                # refresh credentials using this tenant
-                client_driver = self.driver.client_driver(caller=deployment_user.user,
-                                                          tenant=tenant.name, 
-                                                          deployment=slice_deployment.deployment.name)
-
-
-        if slice_deployment.id and slice_deployment.tenant_id:
-            # update existing tenant
-            driver = self.driver.admin_driver(deployment=slice_deployment.deployment.name)
-            driver.update_tenant(slice_deployment.tenant_id,
-                                 description=slice_deployment.slice.description,
-                                 enabled=slice_deployment.slice.enabled)  
-
-        if slice_deployment.tenant_id:
-            # update slice/tenant quota
-            driver = self.driver.client_driver(deployment=slice_deployment.deployment.name,
-                                              tenant=slice_deployment.slice.name)
-            driver.shell.nova.quotas.update(tenant_id=slice_deployment.tenant_id, instances=int(slice_deployment.slice.max_slivers)) 
-
-        slice_deployment.save()
diff --git a/planetstack/ec2_observer/steps/sync_slice_memberships.py b/planetstack/ec2_observer/steps/sync_slice_memberships.py
deleted file mode 100644
index b6b1638..0000000
--- a/planetstack/ec2_observer/steps/sync_slice_memberships.py
+++ /dev/null
@@ -1,29 +0,0 @@
-import os
-import base64
-from django.db.models import F, Q
-from planetstack.config import Config
-from observer.openstacksyncstep import OpenStackSyncStep
-from core.models.slice import *
-from core.models.user import UserDeployments
-
-class SyncSliceMemberships(OpenStackSyncStep):
-    requested_interval=0
-    provides=[SlicePrivilege]
-
-    def fetch_pending(self):
-        return SlicePrivilege.objects.filter(Q(enacted__lt=F('updated')) | Q(enacted=None))
-
-    def sync_record(self, slice_memb):
-        # sync slice memberships at all slice deployments 
-        slice_deployments = SliceDeployments.objects.filter(slice=slice_memb.slice)
-        for slice_deployment in slice_deployments:
-            if not slice_deployment.tenant_id:
-                continue
-            user_deployments = UserDeployments.objects.filter(deployment=slice_deployment.deployment,
-                                                              user=slice_memb.user)
-            if user_deployments:
-                kuser_id  = user_deployments[0].kuser_id
-                driver = self.driver.admin_driver(deployment=slice_deployment.deployment.name)
-                driver.add_user_role(kuser_id,
-                                     slice_deployment.tenant_id,
-                                     slice_memb.role.role)
diff --git a/planetstack/ec2_observer/steps/sync_slices.py b/planetstack/ec2_observer/steps/sync_slices.py
deleted file mode 100644
index 6cf0772..0000000
--- a/planetstack/ec2_observer/steps/sync_slices.py
+++ /dev/null
@@ -1,23 +0,0 @@
-import os
-import base64
-from netaddr import IPAddress, IPNetwork
-from django.db.models import F, Q
-from planetstack.config import Config
-from observer.openstacksyncstep import OpenStackSyncStep
-from core.models.slice import Slice, SliceDeployments
-from util.logger import Logger, logging
-
-logger = Logger(level=logging.INFO)
-
-class SyncSlices(OpenStackSyncStep):
-    provides=[Slice]
-    requested_interval=0
-
-    def fetch_pending(self):
-        return Slice.objects.filter(Q(enacted__lt=F('updated')) | Q(enacted=None))
-
-    def sync_record(self, slice):
-        for slice_deployment in SliceDeployments.objects.filter(slice=slice):
-            # bump the 'updated' timestamp and trigger observer to update
-            # slice across all deployments 
-            slice_deployment.save()    
diff --git a/planetstack/ec2_observer/steps/sync_sliver_ips.py b/planetstack/ec2_observer/steps/sync_sliver_ips.py
deleted file mode 100644
index e2212d1..0000000
--- a/planetstack/ec2_observer/steps/sync_sliver_ips.py
+++ /dev/null
@@ -1,29 +0,0 @@
-import os
-import base64
-from django.db.models import F, Q
-from planetstack.config import Config
-from observer.openstacksyncstep import OpenStackSyncStep
-from core.models.sliver import Sliver
-
-class SyncSliverIps(OpenStackSyncStep):
-    provides=[Sliver]
-    requested_interval=0
-
-    def fetch_pending(self):
-        slivers = Sliver.objects.filter(ip=None)
-        return slivers
-
-    def sync_record(self, sliver):
-        driver = self.driver.client_driver(tenant=sliver.slice.name, 
-                                           deployment=sliver.node.deployment.name)  
-        servers = driver.shell.nova.servers.findall(id=sliver.instance_id)
-        if not servers:
-            return
-        server = servers[0]
-        ips = server.addresses.get(sliver.slice.name, [])
-        if not ips:
-            return
-        sliver.ip = ips[0]['addr']
-        if sliver.ip:
-            sliver.save()
-            logger.info("saved sliver ip: %s %s" % (sliver, ips[0]))
diff --git a/planetstack/ec2_observer/steps/sync_user_deployments.py b/planetstack/ec2_observer/steps/sync_user_deployments.py
deleted file mode 100644
index 39943f7..0000000
--- a/planetstack/ec2_observer/steps/sync_user_deployments.py
+++ /dev/null
@@ -1,98 +0,0 @@
-import os
-import base64
-import hashlib
-from collections import defaultdict
-from django.db.models import F, Q
-from planetstack.config import Config
-from observer.openstacksyncstep import OpenStackSyncStep
-from core.models.site import SiteDeployments, Deployment
-from core.models.user import User, UserDeployments
-from util.logger import Logger, logging
-
-logger = Logger(level=logging.INFO)
-
-class SyncUserDeployments(OpenStackSyncStep):
-    provides=[User, UserDeployments]
-    requested_interval=0
-
-    def fetch_pending(self):
-        # user deployments are not visible to users. We must ensure
-        # user are deployed at all deploymets available to their sites.
-
-        deployments = Deployment.objects.all()
-        site_deployments = SiteDeployments.objects.all()
-        site_deploy_lookup = defaultdict(list)
-        for site_deployment in site_deployments:
-            site_deploy_lookup[site_deployment.site].append(site_deployment.deployment)
-
-        user_deploy_lookup = defaultdict(list)
-        for user_deployment in UserDeployments.objects.all():
-            user_deploy_lookup[user_deployment.user].append(user_deployment.deployment)
-       
-        all_deployments = Deployment.objects.filter() 
-        for user in User.objects.all():
-            if user.is_admin:
-                # admins should have an account at all deployments
-                expected_deployments = deployments
-            else:
-                # normal users should have an account at their site's deployments
-                #expected_deployments = site_deploy_lookup[user.site]
-                # users are added to all deployments for now
-                expected_deployments = deployments        
-            for expected_deployment in expected_deployments:
-                if not user in user_deploy_lookup or \
-                  expected_deployment not in user_deploy_lookup[user]: 
-                    # add new record
-                    ud = UserDeployments(user=user, deployment=expected_deployment)
-                    ud.save()
-                    #user_deployments.append(ud)
-                #else:
-                #    # update existing record
-                #    ud = UserDeployments.objects.get(user=user, deployment=expected_deployment)
-                #    user_deployments.append(ud)
-
-        return UserDeployments.objects.filter(Q(enacted__lt=F('updated')) | Q(enacted=None)) 
-
-    def sync_record(self, user_deployment):
-        logger.info("sync'ing user %s at deployment %s" % (user_deployment.user, user_deployment.deployment.name))
-        name = user_deployment.user.email[:user_deployment.user.email.find('@')]
-        user_fields = {'name': user_deployment.user.email,
-                       'email': user_deployment.user.email,
-                       'password': hashlib.md5(user_deployment.user.password).hexdigest()[:6],
-                       'enabled': True}    
-        driver = self.driver.admin_driver(deployment=user_deployment.deployment.name)
-        if not user_deployment.kuser_id:
-            keystone_user = driver.create_user(**user_fields)
-            user_deployment.kuser_id = keystone_user.id
-        else:
-            driver.update_user(user_deployment.kuser_id, user_fields)
-
-        # setup user deployment home site roles  
-        if user_deployment.user.site:
-            site_deployments = SiteDeployments.objects.filter(site=user_deployment.user.site,
-                                                              deployment=user_deployment.deployment)
-            if site_deployments:
-                # need the correct tenant id for site at the deployment
-                tenant_id = site_deployments[0].tenant_id  
-                driver.add_user_role(user_deployment.kuser_id, 
-                                     tenant_id, 'user')
-                if user_deployment.user.is_admin:
-                    driver.add_user_role(user_deployment.kuser_id, tenant_id, 'admin')
-                else:
-                    # may have admin role so attempt to remove it
-                    driver.delete_user_role(user_deployment.kuser_id, tenant_id, 'admin')
-
-        #if user_deployment.user.public_key:
-        #    if not user_deployment.user.keyname:
-        #        keyname = user_deployment.user.email.lower().replace('@', 'AT').replace('.', '')
-        #        user_deployment.user.keyname = keyname
-        #        user_deployment.user.save()
-        #    
-        #    user_driver = driver.client_driver(caller=user_deployment.user, 
-        #                                       tenant=user_deployment.user.site.login_base, 
-        #                                       deployment=user_deployment.deployment.name)
-        #    key_fields =  {'name': user_deployment.user.keyname,
-        #                   'public_key': user_deployment.user.public_key}
-        #    user_driver.create_keypair(**key_fields)
-
-        user_deployment.save()
