Revision afee0879

b/lib/cmdlib.py
1437 1437
      _AdjustCandidatePool(self)
1438 1438

  
1439 1439

  
1440
class LURedistributeConfig(NoHooksLU):
1441
  """Force the redistribution of cluster configuration.
1442

  
1443
  This is a very simple LU.
1444

  
1445
  """
1446
  _OP_REQP = []
1447
  REQ_BGL = False
1448

  
1449
  def ExpandNames(self):
1450
    self.needed_locks = {
1451
      locking.LEVEL_NODE: locking.ALL_SET,
1452
    }
1453
    self.share_locks[locking.LEVEL_NODE] = 1
1454

  
1455
  def CheckPrereq(self):
1456
    """Check prerequisites.
1457

  
1458
    """
1459

  
1460
  def Exec(self, feedback_fn):
1461
    """Redistribute the configuration.
1462

  
1463
    """
1464
    self.cfg.Update(self.cfg.GetClusterInfo())
1465

  
1466

  
1440 1467
def _WaitForSync(lu, instance, oneshot=False, unlock=False):
1441 1468
  """Sleep and poll for an instance's disk to sync.
1442 1469

  
b/lib/mcpu.py
49 49
    opcodes.OpRenameCluster: cmdlib.LURenameCluster,
50 50
    opcodes.OpVerifyDisks: cmdlib.LUVerifyDisks,
51 51
    opcodes.OpSetClusterParams: cmdlib.LUSetClusterParams,
52
    opcodes.OpRedistributeConfig: cmdlib.LURedistributeConfig,
52 53
    # node lu
53 54
    opcodes.OpAddNode: cmdlib.LUAddNode,
54 55
    opcodes.OpQueryNodes: cmdlib.LUQueryNodes,
b/lib/opcodes.py
171 171
    return txt
172 172

  
173 173

  
174
# cluster opcodes
175

  
174 176
class OpDestroyCluster(OpCode):
175 177
  """Destroy the cluster.
176 178

  
......
264 266
    ]
265 267

  
266 268

  
269
class OpRedistributeConfig(OpCode):
270
  """Force a full push of the cluster configuration.
271

  
272
  """
273
  OP_ID = "OP_CLUSTER_REDIST_CONF"
274
  __slots__ = [
275
    ]
276

  
267 277
# node opcodes
268 278

  
269 279
class OpRemoveNode(OpCode):
b/scripts/gnt-cluster
177 177
  return 0
178 178

  
179 179

  
180
def RedistributeConfig(opts, args):
181
  """Forces push of the cluster configuration.
182

  
183
  @param opts: the command line options selected by the user
184
  @type args: list
185
  @param args: empty list
186
  @rtype: int
187
  @return: the desired exit code
188

  
189
  """
190
  op = opcodes.OpRedistributeConf()
191
  SubmitOrSend(op, opts)
192
  return 0
193

  
194

  
180 195
def ShowClusterVersion(opts, args):
181 196
  """Write version of ganeti software to the standard output.
182 197

  
......
589 604
  'rename': (RenameCluster, ARGS_ONE, [DEBUG_OPT, FORCE_OPT],
590 605
               "<new_name>",
591 606
               "Renames the cluster"),
607
  'redist-conf': (RedistributeConfig, ARGS_NONE, [DEBUG_OPT, SUBMIT_OPT],
608
                  "",
609
                  "Forces a push of the configuration file and ssconf files"
610
                  " to the nodes in the cluster"),
592 611
  'verify': (VerifyCluster, ARGS_NONE, [DEBUG_OPT,
593 612
             make_option("--no-nplus1-mem", dest="skip_nplusone_mem",
594 613
                         help="Skip N+1 memory redundancy tests",

Also available in: Unified diff