aboutsummaryrefslogtreecommitdiffstats
path: root/func/driver.py
diff options
context:
space:
mode:
Diffstat (limited to 'func/driver.py')
-rw-r--r--func/driver.py10
1 files changed, 5 insertions, 5 deletions
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)
-