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
Instance Variables [hide private]
  success
Indicates if all action_cb calls were successful
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)

__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