delete useless image_exists in vping 41/19341/1
authorSerenaFeng <feng.xiaowei@zte.com.cn>
Tue, 23 Aug 2016 03:05:52 +0000 (11:05 +0800)
committerMorgan Richomme <morgan.richomme@orange.com>
Tue, 23 Aug 2016 12:03:34 +0000 (12:03 +0000)
In rally, image_exists is used to decide whether the image
resource should be cleaned or not. But unlike rally,
image_exists in vping is only assigned but not never be actually used.

JIRA: FUNCTEST-426

Change-Id: Id2089dd2a9734ba957cc1c80d4dc31bc27907b0a
Signed-off-by: SerenaFeng <feng.xiaowei@zte.com.cn>
(cherry picked from commit 73053cd38fed875e3e5d64cabfb7fbfeb2839a80)

testcases/OpenStack/vPing/vping.py
testcases/OpenStack/vPing/vping_util.py

index 039e7ec..168ed4f 100755 (executable)
@@ -23,8 +23,6 @@ import functest.utils.functest_logger as ft_logger
 import vping_util as util
 
 parser = argparse.ArgumentParser()
-image_exists = False
-
 parser.add_argument("-d", "--debug", help="Debug mode", action="store_true")
 parser.add_argument("-r", "--report",
                     help="Create json result file",
@@ -52,8 +50,7 @@ def main():
     vmname_1 = util.get_vmname_1()
     vmname_2 = util.get_vmname_2()
 
-    global image_exists
-    image_exists, image_id = util.create_image()
+    image_id = util.create_image()
 
     flavor = util.get_flavor()
 
index d3e081f..c16c5d6 100644 (file)
@@ -153,7 +153,6 @@ def create_image():
     image_id = os_utils.get_image_id(glance_client, GLANCE_IMAGE_NAME)
     if image_id != '':
         logger.info("Using existing image '%s'..." % GLANCE_IMAGE_NAME)
-        image_exists = True
     else:
         logger.info("Creating image '%s' from '%s'..." % (GLANCE_IMAGE_NAME,
                                                           GLANCE_IMAGE_PATH))
@@ -166,9 +165,8 @@ def create_image():
             exit(EXIT_CODE)
         logger.debug("Image '%s' with ID=%s created successfully."
                      % (GLANCE_IMAGE_NAME, image_id))
-        image_exists = True
 
-    return image_exists, image_id
+    return image_id
 
 
 def get_flavor():