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 ###############################################################################
11 from ipmi_adapter import IpmiAdapter
12 from ssh_client import SSHClient
18 DEV = {'pxe': 'bootsource5',
19 'disk': 'bootsource3',
22 ROOT = '/system1/bootconfig1'
25 class HpAdapter(IpmiAdapter):
27 def __init__(self, yaml_path):
28 super(HpAdapter, self).__init__(yaml_path)
30 def node_set_boot_order(self, node_id, boot_order_list):
31 log('Set boot order %s on Node %s' % (boot_order_list, node_id))
32 ip, username, password, ipmiport = self.get_access_info(node_id)
33 ssh = SSHClient(ip, username, password)
35 for order, dev in enumerate(boot_order_list):
36 s.exec_cmd('set %s/%s bootorder=%s'
37 % (ROOT, DEV[dev], order + 1))