diff options
author | Yujun Zhang <zhang.yujunz@zte.com.cn> | 2016-10-17 00:48:11 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@opnfv.org> | 2016-10-17 00:48:11 +0000 |
commit | 507e8c569a699ceab085e01197a32a628c3c88d9 (patch) | |
tree | d968127732826d59b2bbd21970655998449050dd /func | |
parent | 2af11e64cc8b1eb321982be9618417724d529a29 (diff) | |
parent | eddc35b497362c0c01e612d66ed19c4d5c9dd328 (diff) |
Merge "Adjust directory structure"
Diffstat (limited to 'func')
-rw-r--r-- | func/driver.py | 4 | ||||
-rw-r--r-- | func/env_setup.py | 8 | ||||
-rw-r--r-- | func/spawn_vm.py | 8 |
3 files changed, 10 insertions, 10 deletions
diff --git a/func/driver.py b/func/driver.py index bcda0ce1..9a011c2a 100644 --- a/func/driver.py +++ b/func/driver.py @@ -64,9 +64,9 @@ class Driver: def run_ansible_playbook(self, benchmark, extra_vars): logger.info(extra_vars) ansible_api = AnsibleApi() - ansible_api.execute_playbook('./data/hosts', + ansible_api.execute_playbook('./config/hosts', './benchmarks/playbooks/{0}.yaml'.format(benchmark), - './data/QtipKey', extra_vars) + './config/QtipKey', extra_vars) return self.get_ansible_result(extra_vars['role'], ansible_api.get_detail_playbook_stats()) def drive_bench(self, installer_type, pwd, benchmark, roles, benchmark_fname, diff --git a/func/env_setup.py b/func/env_setup.py index 2655fab9..9e21a5b6 100644 --- a/func/env_setup.py +++ b/func/env_setup.py @@ -46,7 +46,7 @@ class Env_setup: @staticmethod def write_to_file(role): - f_name_2 = open('./data/hosts', 'w') + f_name_2 = open('./config/hosts', 'w') print role.items() for k in role: f_name_2.write('[' + k + ']\n') @@ -62,13 +62,13 @@ class Env_setup: os.system('ssh-keyscan %s >> /root/.ssh/known_hosts' % ip) time.sleep(2) - ssh_cmd = './data/qtip_creds.sh %s' % ip + ssh_cmd = './scripts/qtip_creds.sh %s' % ip logger.info("run command: %s " % ssh_cmd) os.system(ssh_cmd) ssh = paramiko.SSHClient() ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy()) - ssh.connect(ip, key_filename='./data/QtipKey') + ssh.connect(ip, key_filename='./config/QtipKey') for attempts in range(100): try: @@ -109,7 +109,7 @@ class Env_setup: if not installer_ip: raise RuntimeError("undefine environment variable INSTALLER_IP") - cmd = "bash ./data/fetch_compute_ips.sh -i %s -a %s" % \ + cmd = "bash ./scripts/fetch_compute_ips.sh -i %s -a %s" % \ (installer_type, installer_ip) logger.info(cmd) os.system(cmd) diff --git a/func/spawn_vm.py b/func/spawn_vm.py index c45af00e..3a16e02d 100644 --- a/func/spawn_vm.py +++ b/func/spawn_vm.py @@ -65,15 +65,15 @@ class SpawnVM(Env_setup): def heat_template_vm(self, vm_params, installer):
Heat_Dic = {}
try:
- with open('./heat/SampleHeat.yaml', 'r+') as H_temp:
+ with open('./config/SampleHeat.yaml', 'r+') as H_temp:
Heat_Dic = yaml.safe_load(H_temp)
except yaml.YAMLError as exc:
if hasattr(exc, 'problem_mark'):
mark = exc.problem_mark
- print 'Error in qtip/heat/SampleHeat.yaml at: (%s,%s)' % (mark.line + 1, mark.column + 1)
+ print 'Error in qtip/config/SampleHeat.yaml at: (%s,%s)' % (mark.line + 1, mark.column + 1)
print 'EXITING PROGRAM. Correct File and restart'
sys.exit(1)
- fopen = open('./data/QtipKey.pub', 'r')
+ fopen = open('./config/QtipKey.pub', 'r')
fopenstr = fopen.read()
fopenstr = fopenstr.rstrip()
scriptcmd = '#!/bin/bash \n echo {0} >> foo.txt \n echo {1} >> /root/.ssh/authorized_keys'.format(
@@ -243,7 +243,7 @@ class SpawnVM(Env_setup): if i['output_key'] == 'KeyPair_PublicKey':
sshkey = str(i['output_value'])
- with open('./data/my_key.pem', 'w') as fopen:
+ with open('./config/my_key.pem', 'w') as fopen:
fopen.write(sshkey)
fopen.close()
print Env_setup.ip_pw_list
|