Do not provide ipmi user and password in virtual deployment 21/38321/1
authorAlex Yang <yangyang1@zte.com.cn>
Fri, 28 Jul 2017 07:45:45 +0000 (15:45 +0800)
committerAlex Yang <yangyang1@zte.com.cn>
Fri, 28 Jul 2017 07:45:45 +0000 (15:45 +0800)
Change-Id: Ib7989bed237a03cdab01fea89aba4e2038815e5f
Signed-off-by: Alex Yang <yangyang1@zte.com.cn>
deploy/tempest.py

index b1e0276..ebd040b 100644 (file)
@@ -82,6 +82,7 @@ def prepare_install():
             print("build pxe...")
             build_pxe_for_discover(cluster_id)
         elif conf['host'] and conf['host'] == 'yes':
+            isbare = False if 'isbare' in conf and conf['isbare'] == 0 else True
             print("discover host...")
             discover_host(hosts_name)
             time.sleep(10)
@@ -90,7 +91,7 @@ def prepare_install():
             cluster_info = get_cluster()
             cluster_id = cluster_info.id
             add_hosts_interface(cluster_id, hosts_info, hosts_name,
-                                host_interface_map, vip)
+                                host_interface_map, vip, isbare)
             if len(hosts_name) == 1:
                 protocol_type = 'LVM'
                 service_name = 'cinder'
@@ -106,7 +107,7 @@ def prepare_install():
                 enable_opendaylight(cluster_id, 'odl_l3')
             elif 'scenario' in conf and 'odl_l2' in conf['scenario']:
                 enable_opendaylight(cluster_id, 'odl_l2')
-            if 'isbare' in conf and conf['isbare'] == 0:
+            if not isbare:
                 install_os_for_vm_step1(cluster_id)
             else:
                 print("daisy baremetal deploy start")
@@ -183,12 +184,13 @@ def get_cluster():
 
 
 def add_hosts_interface(cluster_id, hosts_info, hosts_name, host_interface_map,
-                        vip):
+                        vip, isbare):
     for host_name, host in zip(hosts_name, hosts_info):
         host = host.to_dict()
         host['cluster'] = cluster_id
-        host['ipmi_user'] = 'zteroot'
-        host['ipmi_passwd'] = 'superuser'
+        if isbare:
+            host['ipmi_user'] = 'zteroot'
+            host['ipmi_passwd'] = 'superuser'
         for interface in host['interfaces']:
             interface_name = interface['name']
             if interface_name in host_interface_map: