Updates docs for SR1 with final revision
[genesis.git] / fuel / deploy / dha_adapters / hp_adapter.py
1 ###############################################################################
2 # Copyright (c) 2015 Ericsson AB and others.
3 # szilard.cserey@ericsson.com
4 # All rights reserved. This program and the accompanying materials
5 # are made available under the terms of the Apache License, Version 2.0
6 # which accompanies this distribution, and is available at
7 # http://www.apache.org/licenses/LICENSE-2.0
8 ###############################################################################
9
10
11 import common
12 from ipmi_adapter import IpmiAdapter
13 from ssh_client import SSHClient
14
15 log = common.log
16
17 DEV = {'pxe': 'bootsource5',
18        'disk': 'bootsource3',
19        'iso': 'bootsource1'}
20
21 ROOT = '/system1/bootconfig1'
22
23
24 class HpAdapter(IpmiAdapter):
25
26     def __init__(self, yaml_path):
27         super(HpAdapter, self).__init__(yaml_path)
28
29     def node_set_boot_order(self, node_id, boot_order_list):
30         log('Set boot order %s on Node %s' % (boot_order_list, node_id))
31         ip, username, password = self.get_access_info(node_id)
32         ssh = SSHClient(ip, username, password)
33         with ssh as s:
34             for order, dev in enumerate(boot_order_list):
35                 s.exec_cmd('set %s/%s bootorder=%s'
36                            % (ROOT, DEV[dev], order + 1))