diff options
author | Alex Yang <yangyang1@zte.com.cn> | 2017-09-05 17:32:23 +0800 |
---|---|---|
committer | Alex Yang <yangyang1@zte.com.cn> | 2017-09-06 10:08:28 +0800 |
commit | 95aec0a10931ecc61981dba49c93c5bea8d48960 (patch) | |
tree | 638ad1910ec68a1f58f9c1006439938525595b77 /deploy/environment.py | |
parent | 81c6480386c45b9909b1de50970717a5f5f3533e (diff) |
Eliminate hard coding about ipmi info
1. Eliminate hard coding
2. Add ipmi info in schemas
3. Add unit test
Change-Id: I4561bbc9454e02fd1de2106645db341a4129245b
Signed-off-by: Alex Yang <yangyang1@zte.com.cn>
Diffstat (limited to 'deploy/environment.py')
-rw-r--r-- | deploy/environment.py | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/deploy/environment.py b/deploy/environment.py index dd9e0142..5371e6ca 100644 --- a/deploy/environment.py +++ b/deploy/environment.py @@ -147,17 +147,15 @@ class BareMetalEnvironment(DaisyEnvironmentBase): disks=[self.daisy_server_info['image']]) def reboot_nodes(self, boot_dev=None): - # TODO: add ipmi info into deploy.yml, or read from PDF - address = 106 for node in self.deploy_struct['hosts']: - node['ipmiIp'] = '192.168.1.' + str(address) - address += 1 - if address > 111: - err_exit('the ipmi address exceeds the range 106~110') - node['ipmiUser'] = 'zteroot' - node['ipmiPass'] = 'superuser' - ipmi_reboot_node(node['ipmiIp'], node['ipmiUser'], - node['ipmiPass'], boot_source=boot_dev) + if 'ipmi_ip' not in node \ + or 'ipmi_user' not in node \ + or 'ipmi_pass' not in node: + err_exit('Missing ipmi information') + ipmi_reboot_node(node['ipmi_ip'], + node['ipmi_user'], + node['ipmi_pass'], + boot_source=boot_dev) def deploy(self, deploy_file, net_file): self.server.prepare_cluster(deploy_file, net_file) |