diff options
author | zhifeng.jiang <jiang.zhifeng@zte.com.cn> | 2016-05-20 15:56:13 +0800 |
---|---|---|
committer | zhifeng.jiang <jiang.zhifeng@zte.com.cn> | 2016-05-23 08:37:48 +0800 |
commit | 1dd916e557d60a05dcedc0e741ab7cbb94f85c64 (patch) | |
tree | f75bdccf86d853f295813cde9b129b1695f2a033 /func/env_setup.py | |
parent | 4c22b78737cca49bc6459b10e7f7b6e550d56d63 (diff) |
Read the proxy info from testcase, and set it to hosts when dhrystone benchmarks test.
modification:
Write the git_proxy_pbook.yaml to set git proxy info in hosts or vms.
Write the sys_proxy_pbook.yaml to set yum apt wget env proxy info in hosts or vms.
Change the dhrystone.yaml to include proxy and add the zte-pod1 /compute/dhrystone_bm.yaml.Tested and passed.Other playbooks did not include the proxy yet. I will test and push lately.
QTIP-74
Change-Id: Ia820bc32798b9f1f6f4165a111524e04c129a5df
Signed-off-by: zhifeng.jiang <jiang.zhifeng@zte.com.cn>
Diffstat (limited to 'func/env_setup.py')
-rw-r--r-- | func/env_setup.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/func/env_setup.py b/func/env_setup.py index 9fd7c106..487d7af3 100644 --- a/func/env_setup.py +++ b/func/env_setup.py @@ -31,6 +31,7 @@ class Env_setup(): self.roles_dict.clear() self.ip_pw_dict.clear() self.ip_pip_list[:] = [] + self.proxy_info = {} self.vm_parameters.clear() self.benchmark_details.clear() self.benchmark = '' @@ -141,6 +142,10 @@ class Env_setup(): self.GetHostMachineinfo(doc['Context']['Host_Machines']) if doc.get('Scenario',{}).get('benchmark_details',{}): self.GetBenchmarkDetails(doc.get('Scenario',{}).get('benchmark_details',{})) + if 'Proxy_Environment' in doc['Context'].keys(): + self.proxy_info['http_proxy'] = doc['Context']['Proxy_Environment']['http_proxy'] + self.proxy_info['https_proxy'] = doc['Context']['Proxy_Environment']['https_proxy'] + self.proxy_info['no_proxy'] = doc['Context']['Proxy_Environment']['no_proxy'] for k, v in self.roles_ip_list: self.roles_dict[k].append(v) for k, v in self.ip_pw_list: @@ -150,7 +155,9 @@ class Env_setup(): self.roles_dict.items(), self.vm_parameters, self.benchmark_details.items(), - self.ip_pw_dict.items()) + self.ip_pw_dict.items(), + self.proxy_info) + except KeyboardInterrupt: fname.close() print 'ConfigFile Closed: exiting!' |