Revision a6070ef7 lib/query.py

b/lib/query.py
421 421
  return (constants.QRFS_NORMAL, ng.name)
422 422

  
423 423

  
424
def _GetLiveNodeField(field, kind, ctx, _):
424
def _GetLiveNodeField(field, kind, ctx, node):
425 425
  """Gets the value of a "live" field from L{NodeQueryData}.
426 426

  
427 427
  @param field: Live field name
428 428
  @param kind: Data kind, one of L{constants.QFT_ALL}
429 429
  @type ctx: L{NodeQueryData}
430
  @type node: L{objects.Node}
431
  @param node: Node object
430 432

  
431 433
  """
434
  if node.offline:
435
    return (constants.QRFS_OFFLINE, None)
436

  
432 437
  if not ctx.curlive_data:
433 438
    return (constants.QRFS_NODATA, None)
434 439

  
......
571 576
  @param inst: Instance object
572 577

  
573 578
  """
579
  # Can't use QRFS_OFFLINE here as it would describe the instance to be offline
580
  # when we actually don't know due to missing data
574 581
  if inst.primary_node in ctx.bad_nodes:
575 582
    return (constants.QRFS_NODATA, None)
576 583
  else:
......
594 601
    """
595 602
    if (inst.primary_node in ctx.bad_nodes or
596 603
        inst.primary_node in ctx.offline_nodes):
604
      # Can't use QRFS_OFFLINE here as it would describe the instance to be
605
      # offline when we actually don't know due to missing data
597 606
      return (constants.QRFS_NODATA, None)
598 607

  
599 608
    if inst.name in ctx.live_data:

Also available in: Unified diff