Corrected links associated with release docs. To be updated along with the previous...
[genesis.git] / fuel / deploy / dha_adapters / hp_adapter.py
1 import common
2 from ipmi_adapter import IpmiAdapter
3 from ssh_client import SSHClient
4
5 log = common.log
6
7 DEV = {'pxe': 'bootsource5',
8        'disk': 'bootsource3',
9        'iso': 'bootsource1'}
10
11 ROOT = '/system1/bootconfig1'
12
13 class HpAdapter(IpmiAdapter):
14
15     def __init__(self, yaml_path):
16         super(HpAdapter, self).__init__(yaml_path)
17
18     def node_set_boot_order(self, node_id, boot_order_list):
19         log('Set boot order %s on Node %s' % (boot_order_list, node_id))
20         ip, username, password = self.get_access_info(node_id)
21         ssh = SSHClient(ip, username, password)
22         for order, dev in enumerate(boot_order_list):
23             with ssh as s:
24                 s.exec_cmd('set %s/%s bootorder=%s'
25                            % (ROOT, DEV[dev], order+1))