from ganeti import opcodes
from ganeti import constants
from ganeti import errors
-from ganeti import rpc
from ganeti import cmdlib
from ganeti import locking
from ganeti import utils
self.context = context
self._ec_id = ec_id
self._cbs = None
- self.rpc = rpc.RpcRunner(context.cfg)
+ self.rpc = context.rpc
self.hmclass = HooksMaster
def _AcquireLocks(self, level, names, shared, timeout, priority):
class RpcRunner(object):
- """RPC runner class"""
+ """RPC runner class.
- def __init__(self, cfg):
- """Initialized the rpc runner.
+ """
+ def __init__(self, context):
+ """Initialized the RPC runner.
- @type cfg: C{config.ConfigWriter}
- @param cfg: the configuration object that will be used to get data
- about the cluster
+ @type context: C{masterd.GanetiContext}
+ @param context: Ganeti context
"""
- self._cfg = cfg
+ self._cfg = context.cfg
self.port = netutils.GetDaemonPort(constants.NODED)
def _InstDict(self, instance, hvp=None, bep=None, osp=None):
# Job queue
self.jobqueue = jqueue.JobQueue(self)
+ # RPC runner
+ self.rpc = rpc.RpcRunner(self)
+
# setting this also locks the class against attribute modifications
self.__class__._instance = self