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>
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],