bump response index in map_sync_outputs where we've added a get_token task to the corresponding playbook
diff --git a/xos/openstack_observer/steps/sync_controller_images.py b/xos/openstack_observer/steps/sync_controller_images.py
index 551d9ac..843bfb6 100644
--- a/xos/openstack_observer/steps/sync_controller_images.py
+++ b/xos/openstack_observer/steps/sync_controller_images.py
@@ -38,7 +38,7 @@
return image_fields
def map_sync_outputs(self, controller_image, res):
- image_id = res[0]['id']
+ image_id = res[1]['id']
controller_image.glance_image_id = image_id
controller_image.backend_status = '1 - OK'
controller_image.save()
diff --git a/xos/openstack_observer/steps/sync_controller_networks.py b/xos/openstack_observer/steps/sync_controller_networks.py
index 1e7805f..5b46bff 100644
--- a/xos/openstack_observer/steps/sync_controller_networks.py
+++ b/xos/openstack_observer/steps/sync_controller_networks.py
@@ -56,8 +56,8 @@
return network_fields
def map_sync_outputs(self, controller_network,res):
- network_id = res[0]['id']
- subnet_id = res[1]['id']
+ network_id = res[1]['id']
+ subnet_id = res[2]['id']
controller_network.net_id = network_id
controller_network.subnet = self.cidr
controller_network.subnet_id = subnet_id
diff --git a/xos/openstack_observer/steps/sync_controller_site_privileges.py b/xos/openstack_observer/steps/sync_controller_site_privileges.py
index d257536..3c0012b 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[0]['id']
+ controller_site_privilege.role_id = res[1]['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 614d435..10142a1 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[0]['id']
+ controller_site.tenant_id = res[1]['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 4129802..c6ff4b7 100644
--- a/xos/openstack_observer/steps/sync_controller_sites.yaml
+++ b/xos/openstack_observer/steps/sync_controller_sites.yaml
@@ -2,4 +2,7 @@
- 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 9904aef..b1098c5 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[0]['id']
+ tenant_id = res[1]['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_users.py b/xos/openstack_observer/steps/sync_controller_users.py
index 4062453..a993c83 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[0]['id']
+ controller_user.kuser_id = res[1]['id']
controller_user.backend_status = '1 - OK'
controller_user.save()