diff options
Diffstat (limited to 'utils/infra_setup/runner/yardstick.py')
-rw-r--r-- | utils/infra_setup/runner/yardstick.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/utils/infra_setup/runner/yardstick.py b/utils/infra_setup/runner/yardstick.py index 559b9c10..616bcc52 100644 --- a/utils/infra_setup/runner/yardstick.py +++ b/utils/infra_setup/runner/yardstick.py @@ -15,15 +15,27 @@ At present, This file contain the following function: 4.how the process of task.''' import sys +import os import time import requests import json +import urllib import utils.logger as logger +from utils.parser import Parser as config +import utils.env_prepare.stack_prepare as env headers = {"Content-Type": "application/json"} LOG = logger.Logger(__name__).getLogger() +def yardstick_image_prepare(): + if not os.path.exists(config.bottlenecks_config["yardstick_image_dir"]): + urllib.urlretrieve(config.bottlenecks_config["image_url"], + config.bottlenecks_config["yardstick_image_dir"]) + env.prepare_image(config.bottlenecks_config["yardstick_image_name"], + config.bottlenecks_config["yardstick_image_dir"]) + + def yardstick_command_parser(debug, cidr, outfile, parameter): cmd = "yardstick" if debug: @@ -31,6 +43,9 @@ def yardstick_command_parser(debug, cidr, outfile, parameter): cmd += " task start " cmd += str(cidr) cmd += " --output-file " + outfile + image_name = config.bottlenecks_config["yardstick_image_name"] + parameter["image_name"] = image_name + print parameter if parameter is not None: cmd += " --task-args " + '"' + str(parameter) + '"' return cmd |