Revision b5f5fae9

b/lib/cmdlib.py
749 749
  return []
750 750

  
751 751

  
752
class LUPostInitCluster(LogicalUnit):
753
  """Logical unit for running hooks after cluster initialization.
754

  
755
  """
756
  HPATH = "cluster-init"
757
  HTYPE = constants.HTYPE_CLUSTER
758
  _OP_REQP = []
759

  
760
  def BuildHooksEnv(self):
761
    """Build hooks env.
762

  
763
    """
764
    env = {"OP_TARGET": self.cfg.GetClusterName()}
765
    mn = self.cfg.GetMasterNode()
766
    return env, [], [mn]
767

  
768
  def CheckPrereq(self):
769
    """No prerequisites to check.
770

  
771
    """
772
    return True
773

  
774
  def Exec(self, feedback_fn):
775
    """Nothing to do.
776

  
777
    """
778
    return True
779

  
780

  
752 781
class LUDestroyCluster(NoHooksLU):
753 782
  """Logical unit for destroying the cluster.
754 783

  
b/lib/mcpu.py
42 42
  """Object which runs OpCodes"""
43 43
  DISPATCH_TABLE = {
44 44
    # Cluster
45
    opcodes.OpPostInitCluster: cmdlib.LUPostInitCluster,
45 46
    opcodes.OpDestroyCluster: cmdlib.LUDestroyCluster,
46 47
    opcodes.OpQueryClusterInfo: cmdlib.LUQueryClusterInfo,
47 48
    opcodes.OpVerifyCluster: cmdlib.LUVerifyCluster,
b/lib/opcodes.py
170 170

  
171 171
# cluster opcodes
172 172

  
173
class OpPostInitCluster(OpCode):
174
  """Post cluster initialization.
175

  
176
  This opcode does not touch the cluster at all. Its purpose is to run hooks
177
  after the cluster has been initialized.
178

  
179
  """
180
  OP_ID = "OP_CLUSTER_POST_INIT"
181
  __slots__ = OpCode.__slots__ + []
182

  
183

  
173 184
class OpDestroyCluster(OpCode):
174 185
  """Destroy the cluster.
175 186

  

Also available in: Unified diff