Merge branch 'master' of github.com:open-cloud/xos
diff --git a/xos/openstack_observer/steps/sync_controller_site_privileges.py b/xos/openstack_observer/steps/sync_controller_site_privileges.py
index 3c0012b..d257536 100644
--- a/xos/openstack_observer/steps/sync_controller_site_privileges.py
+++ b/xos/openstack_observer/steps/sync_controller_site_privileges.py
@@ -59,7 +59,7 @@
 	    # "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.
-            controller_site_privilege.role_id = res[1]['id']
+            controller_site_privilege.role_id = res[0]['id']
             controller_site_privilege.save()
 
     def delete_record(self, controller_site_privilege):
diff --git a/xos/openstack_observer/steps/sync_controller_sites.py b/xos/openstack_observer/steps/sync_controller_sites.py
index 10142a1..614d435 100644
--- a/xos/openstack_observer/steps/sync_controller_sites.py
+++ b/xos/openstack_observer/steps/sync_controller_sites.py
@@ -32,7 +32,7 @@
         return tenant_fields
 
     def map_sync_outputs(self, controller_site, res):
-	controller_site.tenant_id = res[1]['id']
+	controller_site.tenant_id = res[0]['id']
 	controller_site.backend_status = '1 - OK'
         controller_site.save()
             
diff --git a/xos/openstack_observer/steps/sync_controller_sites.yaml b/xos/openstack_observer/steps/sync_controller_sites.yaml
index c6ff4b7..4129802 100644
--- a/xos/openstack_observer/steps/sync_controller_sites.yaml
+++ b/xos/openstack_observer/steps/sync_controller_sites.yaml
@@ -2,7 +2,4 @@
 - hosts: 127.0.0.1
   connection: local
   tasks:
-  - shell: ENDPOINT={{endpoint_v3}} USERNAME={{admin_user}} PASSWORD={{admin_password}} TENANT={{admin_tenant}} DOMAIN={{domain}} /opt/xos/openstack/get_token.sh
-    register: token 
-
   - keystone_user: endpoint={{ endpoint }} login_user={{ admin_user }} login_password={{ admin_password }} login_tenant_name={{ admin_tenant }} tenant={{ tenant }} tenant_description="{{ tenant_description }}"
diff --git a/xos/openstack_observer/steps/sync_controller_slices.py b/xos/openstack_observer/steps/sync_controller_slices.py
index b1098c5..9904aef 100644
--- a/xos/openstack_observer/steps/sync_controller_slices.py
+++ b/xos/openstack_observer/steps/sync_controller_slices.py
@@ -50,7 +50,7 @@
         return tenant_fields
 
     def map_sync_outputs(self, controller_slice, res):
-        tenant_id = res[1]['id']
+        tenant_id = res[0]['id']
         if (not controller_slice.tenant_id):
             try:
                 driver = OpenStackDriver().admin_driver(controller=controller_slice.controller)
diff --git a/xos/openstack_observer/steps/sync_controller_slices.yaml b/xos/openstack_observer/steps/sync_controller_slices.yaml
index c006738..61470ce 100644
--- a/xos/openstack_observer/steps/sync_controller_slices.yaml
+++ b/xos/openstack_observer/steps/sync_controller_slices.yaml
@@ -2,13 +2,11 @@
 - hosts: 127.0.0.1
   connection: local
   tasks:
-  - shell: ENDPOINT={{endpoint_v3}} USERNAME={{admin_user}} PASSWORD={{admin_password}} TENANT={{admin_tenant}} DOMAIN={{domain}} /opt/xos/openstack/get_token.sh
-    register: token
   {% if delete -%}
-  - keystone_user: endpoint={{ endpoint }} token={{ '{{' }} token.stdout {{ '}}' }} tenant={{ tenant }} tenant_description="{{ tenant_description }}" state=absent
+  - keystone_user: endpoint={{ endpoint }} login_user={{ admin_user }} login_password={{ admin_password }} login_tenant_name={{ admin_tenant }} tenant={{ tenant }} tenant_description="{{ tenant_description }}" state=absent
   {% else -%}
-  - keystone_user: endpoint={{ endpoint }} token={{ '{{' }} token.stdout {{ '}}' }} tenant={{ tenant }} tenant_description="{{ tenant_description }}"
+  - keystone_user: endpoint={{ endpoint }} login_user={{ admin_user }} login_password={{ admin_password }} login_tenant_name={{ admin_tenant }} tenant={{ tenant }} tenant_description="{{ tenant_description }}"
   {% for role in roles %}
-  - keystone_user: endpoint={{ endpoint }} token={{ '{{' }} token.stdout {{ '}}' }} user="{{ name }}" role={{ role }} tenant={{ tenant }}
+  - keystone_user: endpoint={{ endpoint }} login_user={{ admin_user }} login_password={{ admin_password }} login_tenant_name={{ admin_tenant }} user="{{ name }}" role={{ role }} tenant={{ tenant }}
   {% endfor %}
   {% endif %}
diff --git a/xos/openstack_observer/steps/sync_controller_users.py b/xos/openstack_observer/steps/sync_controller_users.py
index a993c83..4062453 100644
--- a/xos/openstack_observer/steps/sync_controller_users.py
+++ b/xos/openstack_observer/steps/sync_controller_users.py
@@ -59,7 +59,7 @@
 	    return user_fields
 
     def map_sync_outputs(self, controller_user, res):
-        controller_user.kuser_id = res[1]['id']
+        controller_user.kuser_id = res[0]['id']
         controller_user.backend_status = '1 - OK'
         controller_user.save()
 
diff --git a/xos/openstack_observer/steps/sync_controller_users.yaml b/xos/openstack_observer/steps/sync_controller_users.yaml
index 1179f52..4f2db5e 100644
--- a/xos/openstack_observer/steps/sync_controller_users.yaml
+++ b/xos/openstack_observer/steps/sync_controller_users.yaml
@@ -2,16 +2,15 @@
 - hosts: 127.0.0.1
   connection: local
   tasks:
-  - shell: ENDPOINT={{endpoint_v3}} USERNAME={{admin_user}} PASSWORD={{admin_password}} TENANT={{admin_tenant}} DOMAIN={{domain}} /opt/xos/openstack/get_token.sh
-    register: token
-
   - keystone_user:
        endpoint={{ endpoint }}
-       token={{ '{{' }} token.stdout {{ '}}' }}
+       login_user={{ admin_user }} 
+       login_password={{ admin_password }} 
+       login_tenant_name={{ admin_tenant }} 
        user="{{ name }}"
        email={{ email }}
        password={{ password }}
        tenant={{ tenant }}
   {% for role in roles %}
-  - keystone_user: endpoint={{ endpoint}} token={{ '{{' }} token.stdout {{ '}}' }} user="{{ name }}" role={{ role }} tenant={{ tenant }}
+  - keystone_user: endpoint={{ endpoint}}  login_user={{ admin_user }} login_password={{ admin_password }} login_tenant_name={{ admin_tenant }} user="{{ name }}" role={{ role }} tenant={{ tenant }}
   {% endfor %}
diff --git a/xos/openstack_observer/steps/sync_ports.py b/xos/openstack_observer/steps/sync_ports.py
index 6b1be57..967bef9 100644
--- a/xos/openstack_observer/steps/sync_ports.py
+++ b/xos/openstack_observer/steps/sync_ports.py
@@ -188,42 +188,6 @@
                     continue
                 port.save()
 
-        # Now, handle port forwarding
-        # We get the list of Ports again, since we might have just
-        # added a few. Then, for each one of them we find it's quantum port and
-        # make sure quantum's nat:forward_ports argument is the same.
-
-        for port in Port.objects.all():
-            try:
-                nat_list = port.network.nat_list
-            except (TypeError, ValueError), e:
-                logger.info("Failed to decode nat_list: %s" % str(e))
-                continue
-
-            if not port.port_id:
-                continue
-
-            neutron_port = ports_by_id.get(port.port_id, None)
-            if not neutron_port:
-                continue
-
-            neutron_nat_list = neutron_port.get("nat:forward_ports", None)
-            if not neutron_nat_list:
-                # make sure that None and the empty set are treated identically
-                neutron_nat_list = []
-
-            if (neutron_nat_list != nat_list):
-                logger.info("Setting nat:forward_ports for port %s network %s instance %s to %s" % (str(port.port_id), str(port.network.id), str(port.instance), str(nat_list)))
-                try:
-                    driver = self.driver.admin_driver(controller=port.instance.node.site_deployment.controller,tenant='admin')
-                    driver.shell.quantum.update_port(port.port_id, {"port": {"nat:forward_ports": nat_list}})
-                except:
-                    logger.log_exc("failed to update port with nat_list %s" % str(nat_list))
-                    continue
-            else:
-                #logger.info("port %s network %s instance %s nat %s is already set" % (str(port.port_id), str(port.network.id), str(port.instance), str(nat_list)))
-                pass
-
     def delete_record(self, network_instance):
         # Nothing to do, this is an OpenCloud object
         pass