Revision 6bf01bbb

b/lib/cmdlib.py
1218 1218

  
1219 1219
  """
1220 1220
  _OP_REQP = ["output_fields", "names"]
1221
  REQ_BGL = False
1221 1222

  
1222
  def CheckPrereq(self):
1223
    """Check prerequisites.
1224

  
1225
    This always succeeds, since this is a pure query LU.
1226

  
1227
    """
1223
  def ExpandNames(self):
1228 1224
    if self.op.names:
1229 1225
      raise errors.OpPrereqError("Selective OS query not supported")
1230 1226

  
......
1233 1229
                       dynamic=self.dynamic_fields,
1234 1230
                       selected=self.op.output_fields)
1235 1231

  
1232
    # Lock all nodes, in shared mode
1233
    self.needed_locks = {}
1234
    self.share_locks[locking.LEVEL_NODE] = 1
1235
    self.needed_locks[locking.LEVEL_NODE] = None
1236

  
1237
  def CheckPrereq(self):
1238
    """Check prerequisites.
1239

  
1240
    """
1241

  
1236 1242
  @staticmethod
1237 1243
  def _DiagnoseByOS(node_list, rlist):
1238 1244
    """Remaps a per-node return list into an a per-os per-node dictionary
......
1268 1274
    """Compute the list of OSes.
1269 1275

  
1270 1276
    """
1271
    node_list = self.cfg.GetNodeList()
1277
    node_list = self.acquired_locks[locking.LEVEL_NODE]
1272 1278
    node_data = rpc.call_os_diagnose(node_list)
1273 1279
    if node_data == False:
1274 1280
      raise errors.OpExecError("Can't gather the list of OSes")

Also available in: Unified diff