Package ganeti :: Package client :: Module gnt_cluster :: Class _RunWhenNodesReachableHelper
[hide private]
[frames] | no frames]

Class _RunWhenNodesReachableHelper

source code


Helper class to make shared internal state sharing easier.

Instance Methods [hide private]
 
__init__(self, node_list, action_cb, node2ip, port, feedback_fn, _ping_fn=netutils.TcpPing, _sleep_fn=time.sleep)
Init the object.
source code
 
__call__(self)
When called we run action_cb.
source code
 
Wait(self, secs)
Checks if a host is up or waits remaining seconds.
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Instance Variables [hide private]
  success
Indicates if all action_cb calls were successful
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, node_list, action_cb, node2ip, port, feedback_fn, _ping_fn=netutils.TcpPing, _sleep_fn=time.sleep)
(Constructor)

source code 

Init the object.

Parameters:
  • node_list - The list of nodes to be reachable
  • action_cb - Callback called when a new host is reachable
  • node2ip (dict) - Node to ip mapping
  • port - The port to use for the TCP ping
  • feedback_fn - The function used for feedback
  • _ping_fn - Function to check reachabilty (for unittest use only)
  • _sleep_fn - Function to sleep (for unittest use only)
Overrides: object.__init__

__call__(self)
(Call operator)

source code 

When called we run action_cb.

Raises:

Wait(self, secs)

source code 

Checks if a host is up or waits remaining seconds.

Parameters:
  • secs - The secs remaining