Revision c53279cf lib/cmdlib.py

b/lib/cmdlib.py
1101 1101
  HPATH = "cluster-modify"
1102 1102
  HTYPE = constants.HTYPE_CLUSTER
1103 1103
  _OP_REQP = []
1104
  REQ_BGL = False
1105

  
1106
  def ExpandNames(self):
1107
    # FIXME: in the future maybe other cluster params won't require checking on
1108
    # all nodes to be modified.
1109
    self.needed_locks = {
1110
      locking.LEVEL_NODE: locking.ALL_SET,
1111
    }
1112
    self.share_locks[locking.LEVEL_NODE] = 1
1104 1113

  
1105 1114
  def BuildHooksEnv(self):
1106 1115
    """Build hooks env.
......
1120 1129
    if the given volume group is valid.
1121 1130

  
1122 1131
    """
1132
    # FIXME: This only works because there is only one parameter that can be
1133
    # changed or removed.
1123 1134
    if not self.op.vg_name:
1124
      instances = [self.cfg.GetInstanceInfo(name)
1125
                   for name in self.cfg.GetInstanceList()]
1135
      instances = self.cfg.GetAllInstancesInfo().values()
1126 1136
      for inst in instances:
1127 1137
        for disk in inst.disks:
1128 1138
          if _RecursiveCheckIfLVMBased(disk):
......
1131 1141

  
1132 1142
    # if vg_name not None, checks given volume group on all nodes
1133 1143
    if self.op.vg_name:
1134
      node_list = self.cfg.GetNodeList()
1144
      node_list = self.acquired_locks[locking.LEVEL_NODE]
1135 1145
      vglist = rpc.call_vg_list(node_list)
1136 1146
      for node in node_list:
1137 1147
        vgstatus = utils.CheckVolumeGroupSize(vglist[node], self.op.vg_name,

Also available in: Unified diff