summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZhijiang Hu <hu.zhijiang@zte.com.cn>2017-08-05 08:25:35 +0800
committerZhijiang Hu <hu.zhijiang@zte.com.cn>2017-08-05 08:25:35 +0800
commit0ce074417403edfe82aad05205366491b16f111e (patch)
tree72196030545e60376233c8ba6cacb1ce5d0adaf9
parent4944b1f3a5b796898db956af5f9084e6bd194b61 (diff)
Revert "Optimize list express to list generator"
This reverts commit e5a787046aff97a9925a35874d2b6535a9a41c0c. Trying to solve [1] Deploy failed!!!.Traceback (most recent call last): File "/home/daisy/deploy/tempest.py", line 94, in prepare_install host_interface_map, vip, isbare) File "/home/daisy/deploy/tempest.py", line 216, in add_hosts_interface add_host_role(cluster_id, host['id'], host_name, host['name'], vip) File "/home/daisy/deploy/tempest.py", line 225, in add_host_role role.name == "COMPUTER"][0] IndexError: list index out of range [1] https://build.opnfv.org/ci/job/daisy-deploy-daily-master/626/consoleFull Change-Id: I4017b4b38fa350a28d9e9dd5b157caab885a80d0 Signed-off-by: Zhijiang Hu <hu.zhijiang@zte.com.cn>
-rw-r--r--deploy/tempest.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/deploy/tempest.py b/deploy/tempest.py
index f9f9e978..b154e72d 100644
--- a/deploy/tempest.py
+++ b/deploy/tempest.py
@@ -219,9 +219,10 @@ def add_hosts_interface(cluster_id, hosts_info, hosts_name, mac_address_map,
def add_host_role(cluster_id, host_id, host_exp_name, host_real_name, vip):
role_meta = {'filters': {'cluster_id': cluster_id}}
role_list_generator = client.roles.list(**role_meta)
- lb_role_id = [role.id for role in role_list_generator if
+ role_list = [role for role in role_list_generator]
+ lb_role_id = [role.id for role in role_list if
role.name == "CONTROLLER_LB"][0]
- computer_role_id = [role.id for role in role_list_generator if
+ computer_role_id = [role.id for role in role_list if
role.name == "COMPUTER"][0]
if host_exp_name in ['all_in_one']:
role_lb_update_meta = {'nodes': [host_id],