Correct the type error of env CLI Option in tempest.py 19/29319/2
authorAlex Yang <yangyang1@zte.com.cn>
Fri, 24 Feb 2017 01:36:32 +0000 (09:36 +0800)
committerAlex Yang <yangyang1@zte.com.cn>
Fri, 24 Feb 2017 05:58:29 +0000 (13:58 +0800)
Change-Id: Id7a4f567c7c81e17c33b5c3ba558fa1cc891b42d
Signed-off-by: Alex Yang <yangyang1@zte.com.cn>
deploy/tempest.py

index 34af9b5..2b72cbc 100644 (file)
@@ -31,7 +31,7 @@ _CLI_OPTS = [
                help='Config cluster'),
     cfg.StrOpt('host',
                help='Config host'),
-    cfg.StrOpt('env',
+    cfg.IntOpt('env',
                help='deploy environment'),
 ]
 
@@ -86,7 +86,7 @@ def prepare_install():
             cluster_id = cluster_info.id
             add_hosts_interface(cluster_id, hosts_info, hosts_name,
                                 host_interface_map, vip)
-            if conf['env'] and conf['env'] == 0:
+            if 'env' in conf and conf['env'] == 0:
                 build_pxe_for_os(cluster_id)
     except Exception:
         print("Deploy failed!!!.%s." % traceback.format_exc())