Revision 29d376ec scripts/gnt-cluster

b/scripts/gnt-cluster
361 361
  """
362 362
  op = opcodes.OpVerifyDisks()
363 363
  result = SubmitOpCode(op)
364
  if not isinstance(result, (list, tuple)) or len(result) != 4:
364
  if not isinstance(result, (list, tuple)) or len(result) != 3:
365 365
    raise errors.ProgrammerError("Unknown result type for OpVerifyDisks")
366 366

  
367
  nodes, nlvm, instances, missing = result
367
  bad_nodes, instances, missing = result
368 368

  
369
  if nodes:
370
    ToStdout("Nodes unreachable or with bad data:")
371
    for name in nodes:
372
      ToStdout("\t%s", name)
373 369
  retcode = constants.EXIT_SUCCESS
374 370

  
375
  if nlvm:
376
    for node, text in nlvm.iteritems():
377
      ToStdout("Error on node %s: LVM error: %s",
371
  if bad_nodes:
372
    for node, text in bad_nodes.items():
373
      ToStdout("Error gathering data on node %s: %s",
378 374
               node, utils.SafeEncode(text[-400:]))
379 375
      retcode |= 1
380 376
      ToStdout("You need to fix these nodes first before fixing instances")
......
394 390

  
395 391
  if missing:
396 392
    for iname, ival in missing.iteritems():
397
      all_missing = utils.all(ival, lambda x: x[0] in nlvm)
393
      all_missing = utils.all(ival, lambda x: x[0] in bad_nodes)
398 394
      if all_missing:
399 395
        ToStdout("Instance %s cannot be verified as it lives on"
400 396
                 " broken nodes", iname)
......
402 398
        ToStdout("Instance %s has missing logical volumes:", iname)
403 399
        ival.sort()
404 400
        for node, vol in ival:
405
          if node in nlvm:
401
          if node in bad_nodes:
406 402
            ToStdout("\tbroken node %s /dev/xenvg/%s", node, vol)
407 403
          else:
408 404
            ToStdout("\t%s /dev/xenvg/%s", node, vol)

Also available in: Unified diff