Skip to content

Commit

Permalink
target: change __init__ paramters
Browse files Browse the repository at this point in the history
Signed-off-by: Heiko Thiery <heiko.thiery@kontron.com>
  • Loading branch information
hthiery committed Mar 30, 2016
1 parent c2173c8 commit 2c2137c
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions pyipmi/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,17 +63,29 @@ class NullRequester(object):
def ipmb_address():
raise AssertionError('NullRequester does not provide an IPMB address')


class Target(object):
def __init__(self, ipmb_address, routing=None):
"""
`ipmb_address` is the IPMB target address
`routing` is the bridging information used to build send message
commands.
"""
self.ipmb_address = ipmb_address
if routing:
self.set_routing(routing)

'''The Target class represents an IPMI target.'''
class Routing:
def __init__(self, address, bridge_channel):
self.address = address
self.bridge_channel = bridge_channel

def __init__(self, ipmb_address):
self.ipmb_address = ipmb_address

def set_routing_information(self, rinfo):
self.set_routing(self, rinfo)

def set_routing(self, rinfo):
"""Set the path over which a target is reachable.
The path is given as a list of tuples in the form (address,
Expand All @@ -82,6 +94,7 @@ def set_routing_information(self, rinfo):

self.routing = [ self.Routing(*r) for r in rinfo ]


class Session(object):
AUTH_TYPE_NONE = 0x00
AUTH_TYPE_MD2 = 0x01
Expand Down

0 comments on commit 2c2137c

Please sign in to comment.