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 ###############################################################################
12 from ipmi_adapter import IpmiAdapter
13 from ssh_client import SSHClient
17 DEV = {'pxe': 'bootsource5',
18 'disk': 'bootsource3',
21 ROOT = '/system1/bootconfig1'
24 class HpAdapter(IpmiAdapter):
26 def __init__(self, yaml_path):
27 super(HpAdapter, self).__init__(yaml_path)
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)
34 for order, dev in enumerate(boot_order_list):
35 s.exec_cmd('set %s/%s bootorder=%s'
36 % (ROOT, DEV[dev], order + 1))