class documentation

class _RunWhenNodesReachableHelper(object):

View In Hierarchy

Helper class to make shared internal state sharing easier.

Method __call__ When called we run action_cb.
Method __init__ Init the object.
Method Wait Checks if a host is up or waits remaining seconds.
Instance Variable action_cb Undocumented
Instance Variable down Undocumented
Instance Variable feedback_fn Undocumented
Instance Variable node2ip Undocumented
Instance Variable port Undocumented
Instance Variable success Indicates if all action_cb calls were successful
Instance Variable up Undocumented
Instance Variable _ping_fn Undocumented
Instance Variable _sleep_fn Undocumented
def __call__(self):

When called we run action_cb.

Raises
utils.RetryAgainWhen there are still down nodes
def __init__(self, node_list, action_cb, node2ip, port, feedback_fn, _ping_fn=netutils.TcpPing, _sleep_fn=time.sleep):

Init the object.

Parameters
node_listThe list of nodes to be reachable
action_cbCallback called when a new host is reachable
node2ip:dictNode to ip mapping
portThe port to use for the TCP ping
feedback_fnThe function used for feedback
_ping_fnFunction to check reachabilty (for unittest use only)
_sleep_fnFunction to sleep (for unittest use only)
def Wait(self, secs):

Checks if a host is up or waits remaining seconds.

Parameters
secsThe secs remaining
action_cb =

Undocumented

down =

Undocumented

feedback_fn =

Undocumented

node2ip =

Undocumented

port =

Undocumented

success: bool =

Indicates if all action_cb calls were successful

up: set =

Undocumented

_ping_fn =

Undocumented

_sleep_fn =

Undocumented