JIRA: YARDSTICK-471
Currently, if we execute the load_image.sh and the openstack already
have this image in the cloud,this script will load another image with
the same name.
This will make yardstick run error.
So I clean this related images before loading.
Change-Id: If5b985ef9b2e890aa10453810fac36867d320a06
Signed-off-by: chenjiankun <chenjiankun1@huawei.com>
# update the external_network
_source_file(rc_file)
+ _clean_images()
+
_load_images()
raise
+def _clean_images():
+ cmd = [config.CLEAN_IMAGES_SCRIPT]
+ p = subprocess.Popen(cmd, stdout=subprocess.PIPE,
+ cwd=config.YARDSTICK_REPOS_DIR)
+ output = p.communicate()[0]
+ logger.debug('The result is: %s', output)
+
+
def _load_images():
cmd = [config.LOAD_IMAGES_SCRIPT]
p = subprocess.Popen(cmd, stdout=subprocess.PIPE,
openstack flavor delete yardstick-flavor &> /dev/null || true
}
+
+main()
+{
+ cleanup
+}
+
+main
source $YARDSTICK_REPO_DIR/tests/ci/clean_images.sh
- cleanup
-
trap "error_exit" EXIT SIGTERM
source $YARDSTICK_REPO_DIR/tests/ci/load_images.sh
OS_FETCH_SCRIPT = 'utils/fetch_os_creds.sh'
+CLEAN_IMAGES_SCRIPT = 'tests/ci/clean_images.sh'
+
LOAD_IMAGES_SCRIPT = 'tests/ci/load_images.sh'
OPENSTACK_RC_FILE = os.path.join(YARDSTICK_CONFIG_DIR, 'openstack.creds')