Revision b6dd32db lib/cmdlib/common.py

b/lib/cmdlib/common.py
918 918
  return op
919 919

  
920 920

  
921
def MapInstanceLvsToNodes(instances):
921
def MapInstanceLvsToNodes(cfg, instances):
922 922
  """Creates a map from (node, volume) to instance name.
923 923

  
924
  @type cfg: L{config.ConfigWriter}
925
  @param cfg: The cluster configuration
924 926
  @type instances: list of L{objects.Instance}
925 927
  @rtype: dict; tuple of (node uuid, volume name) as key, L{objects.Instance}
926 928
          object as value
......
928 930
  """
929 931
  return dict(((node_uuid, vol), inst)
930 932
              for inst in instances
931
              for (node_uuid, vols) in inst.MapLVsByNode().items()
933
              for (node_uuid, vols) in cfg.GetInstanceLVsByNode(inst).items()
932 934
              for vol in vols)
933 935

  
934 936

  

Also available in: Unified diff