diff --git a/planetstack/openstack_observer/steps/sync_controller_users.py b/planetstack/openstack_observer/steps/sync_controller_users.py
index 8f7e508..113869e 100644
--- a/planetstack/openstack_observer/steps/sync_controller_users.py
+++ b/planetstack/openstack_observer/steps/sync_controller_users.py
@@ -1,6 +1,5 @@
 import os
 import base64
-import hashlib
 from collections import defaultdict
 from django.db.models import F, Q
 from planetstack.config import Config
@@ -33,57 +32,53 @@
             return
 
 	template = os_template_env.get_template('sync_controller_users.yaml')
-	
-        name = controller_user.user.email[:controller_user.user.email.find('@')]
 
-        import pdb
-        pdb.set_trace()
+        # All users will have at least the 'user' role at their home site/tenant.
+        # We must also check if the user should have the admin role 		 		
 	roles = ['user']
         if controller_user.user.is_admin:
             roles.append('admin')
-        else:
-            raise Exception('Internal error. Missing controller for user %s'%controller_user.user.email)
    
 	# setup user home site roles at controller 
         if not controller_user.user.site:
-	    raise Exception('Siteless user %s'%controller_user.user.email)
+            raise Exception('Siteless user %s'%controller_user.user.email)
         else:
             # look up tenant id for the user's site at the controller
-            ctrl_site_deployments = ControllerSiteDeployments.objects.filter(
-              site_deployment__site=controller_user.user.site,
-              controller=controller_user.controller)
+            #ctrl_site_deployments = ControllerSiteDeployments.objects.filter(
+            #  site_deployment__site=controller_user.user.site,
+            #  controller=controller_user.controller)
 
-            if ctrl_site_deployments:
-                # need the correct tenant id for site at the controller
-                tenant_id = ctrl_site_deployments[0].tenant_id  
-		tenant_name = ctrl_site_deployments[0].site_deployment.site.login_base
-
-                user_fields = {'endpoint':controller_user.controller.auth_url,
+            #if ctrl_site_deployments:
+            #    # need the correct tenant id for site at the controller
+            #    tenant_id = ctrl_site_deployments[0].tenant_id  
+            #    tenant_name = ctrl_site_deployments[0].site_deployment.site.login_base
+            user_fields = {
+                       'endpoint':controller_user.controller.auth_url,
 		       'name': controller_user.user.email,
                        'email': controller_user.user.email,
-                       'password': hashlib.md5(controller_user.user.password).hexdigest()[:6],
+                       'password': controller_user.user.remote_password,
                        'admin_user': controller_user.controller.admin_user,
 		       'admin_password': controller_user.controller.admin_password,
 	               'ansible_tag':'%s@%s'%(controller_user.user.email.replace('@','-at-'),controller_user.controller.name),
-		       'admin_tenant': 'admin',
+		       'admin_tenant': controller_user.controller.admin_tenant,
 		       'roles':roles,
-		       'tenant':tenant_name}    
+		       'tenant':controller_user.user.site.login_base}    
 	
-	        rendered = template.render(user_fields)
-	        res = run_template('sync_controller_users.yaml', user_fields,path='controller_users')
+	    rendered = template.render(user_fields)
+	    res = run_template('sync_controller_users.yaml', user_fields,path='controller_users')
 
-	        # results is an array in which each element corresponds to an 
-	        # "ok" string received per operation. If we get as many oks as
-	        # the number of operations we issued, that means a grand success.
-	        # Otherwise, the number of oks tell us which operation failed.
-	        expected_length = len(roles) + 1
-	        if (len(res)==expected_length):
-                    controller_user.kuser_id = res[0]['id']
-        	    controller_user.save()
-	        elif (len(res)):
-		    raise Exception('Could not assign roles for user %s'%user_fields['name'])
-	        else:
-		    raise Exception('Could not create or update user %s'%user_fields['name'])
+	    # results is an array in which each element corresponds to an 
+	    # "ok" string received per operation. If we get as many oks as
+	    # the number of operations we issued, that means a grand success.
+	    # Otherwise, the number of oks tell us which operation failed.
+	    expected_length = len(roles) + 1
+	    if (len(res)==expected_length):
+                controller_user.kuser_id = res[0]['id']
+                controller_user.save()
+	    elif (len(res)):
+	        raise Exception('Could not assign roles for user %s'%user_fields['name'])
+	    else:
+	        raise Exception('Could not create or update user %s'%user_fields['name'])
 
     def delete_record(self, controller_user):
         if controller_user.kuser_id:
