From 4c06a4ed3b3b22e3dbcddb33dda33ca773dfae11 Mon Sep 17 00:00:00 2001 From: MofassirArif Date: Tue, 12 Jan 2016 03:12:23 -0800 Subject: error handling for the files being input to the framework. iperf bug fix for the bare metal testing, renamed all the iperf config files. added more detail to the help. Change-Id: I16cfb1c05599cd0b803e735e6a75083e3e6733ec Signed-off-by: MofassirArif --- func/driver.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'func/driver.py') diff --git a/func/driver.py b/func/driver.py index 2cdddba5..0dc0a6e1 100644 --- a/func/driver.py +++ b/func/driver.py @@ -21,6 +21,7 @@ class Driver: self.dic_json = defaultdict() def drive_bench(self, benchmark, roles, benchmark_detail= None, pip_dict = None): + roles= sorted(roles) pip_dict = sorted(pip_dict) result_dir = 'results' @@ -39,12 +40,11 @@ class Driver: if k == '1-server': print values, 'saving IP' self.dic_json['ip'+str(index)]= str(values) - self.dic_json['privateip'+str(index)] = pip_dict[0][1] + if pip_dict[0][1][0]: + self.dic_json['privateip'+str(index)] = pip_dict[0][1] + if not pip_dict[0][1][0]: + self.dic_json['privateip'+str(index)] = 'NONE' index= index+1 dic_json = json.dumps(dict(self.dic_json.items())) - print dic_json run_play = 'ansible-playbook -s ./benchmarks/playbooks/{0} --private-key=./data/QtipKey -i ./data/hosts --extra-vars \'{1}\' -v '.format(benchmark_name, dic_json) -# run_play = 'ansible-playbook -s $PWD/benchmarks/playbooks/{0} --extra-vars "Dest_dir={1} role={2}" -vvv'.format( -# benchmark_name, result_dir, k) status = os.system(run_play) - -- cgit 1.2.3-korg