[baremetal] Bring in opendaylight scenario
[fuel.git] / deploy / dha_adapters / zte_adapter.py
1 ###############################################################################
2 # Copyright (c) 2016 Ericsson AB, ZTE 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 from ipmi_adapter import IpmiAdapter
12
13 from common import (
14     log,
15     exec_cmd,
16 )
17
18
19 class ZteAdapter(IpmiAdapter):
20
21     def __init__(self, yaml_path, attempts=100):
22         super(ZteAdapter, self).__init__(yaml_path, attempts)
23
24     def node_reset(self, node_id):
25         log('RESET Node %s' % node_id)
26         cmd = '%s chassis power cycle' % self.ipmi_cmd(node_id)
27         exec_cmd(cmd, attempts=self.attempts, delay=self.delay,
28                  verbose=True,
29                  mask_args=[8,10])
30