blob: 7be55e9b4bfdfba08c279e13b453da3cbdfd4a5b [file] [log] [blame]
matthew.hart@linaro.org5e4fce92013-08-22 11:29:21 +01001#! /usr/bin/python
2
3# Copyright 2013 Linaro Limited
4# Author Matt Hart <matthew.hart@linaro.org>
5#
6# This program is free software; you can redistribute it and/or modify
7# it under the terms of the GNU General Public License as published by
8# the Free Software Foundation; either version 2 of the License, or
9# (at your option) any later version.
10#
11# This program is distributed in the hope that it will be useful,
12# but WITHOUT ANY WARRANTY; without even the implied warranty of
13# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14# GNU General Public License for more details.
15#
16# You should have received a copy of the GNU General Public License
17# along with this program; if not, write to the Free Software
18# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
19# MA 02110-1301, USA.
20
Matt Hart76fb2542014-06-01 14:24:56 +010021import logging
Neil Williams16579dc2014-02-13 11:20:04 +000022
Matt Hart76fb2542014-06-01 14:24:56 +010023
24class NoDriverException(Exception):
25 pass
26
27
28class PDUDriver(object):
matthew.hart@linaro.org5e4fce92013-08-22 11:29:21 +010029 connection = None
Matt Hart76fb2542014-06-01 14:24:56 +010030 firmware_dict = {}
matthew.hart@linaro.org5e4fce92013-08-22 11:29:21 +010031
32 def __init__(self, connection):
33 self.connection = connection
Matt Hart76fb2542014-06-01 14:24:56 +010034
35 # return the driver that provides the firmware version
36 def _port_interaction(self, command, port_number):
37 pass
38
39 def _pdu_logout(self):
40 pass
41
42 def port_on(self, port_number):
43 self._port_interaction("on", port_number)
44
45 def port_off(self, port_number):
46 self._port_interaction("off", port_number)