Revision a6ab004b lib/cmdlib.py

b/lib/cmdlib.py
1682 1682
                       selected=self.op.output_fields)
1683 1683

  
1684 1684
    # Lock all nodes, in shared mode
1685
    # Temporary removal of locks, should be reverted later
1686
    # TODO: reintroduce locks when they are lighter-weight
1685 1687
    self.needed_locks = {}
1686
    self.share_locks[locking.LEVEL_NODE] = 1
1687
    self.needed_locks[locking.LEVEL_NODE] = locking.ALL_SET
1688
    #self.share_locks[locking.LEVEL_NODE] = 1
1689
    #self.needed_locks[locking.LEVEL_NODE] = locking.ALL_SET
1688 1690

  
1689 1691
  def CheckPrereq(self):
1690 1692
    """Check prerequisites.
......
1708 1710

  
1709 1711
    """
1710 1712
    all_os = {}
1713
    # we build here the list of nodes that didn't fail the RPC (at RPC
1714
    # level), so that nodes with a non-responding node daemon don't
1715
    # make all OSes invalid
1716
    good_nodes = [node_name for node_name in rlist
1717
                  if not rlist[node_name].failed]
1711 1718
    for node_name, nr in rlist.iteritems():
1712 1719
      if nr.failed or not nr.data:
1713 1720
        continue
......
1716 1723
          # build a list of nodes for this os containing empty lists
1717 1724
          # for each node in node_list
1718 1725
          all_os[os_obj.name] = {}
1719
          for nname in node_list:
1726
          for nname in good_nodes:
1720 1727
            all_os[os_obj.name][nname] = []
1721 1728
        all_os[os_obj.name][node_name].append(os_obj)
1722 1729
    return all_os
......
1725 1732
    """Compute the list of OSes.
1726 1733

  
1727 1734
    """
1728
    node_list = self.acquired_locks[locking.LEVEL_NODE]
1729
    valid_nodes = [node for node in self.cfg.GetOnlineNodeList()
1730
                   if node in node_list]
1735
    valid_nodes = [node for node in self.cfg.GetOnlineNodeList()]
1731 1736
    node_data = self.rpc.call_os_diagnose(valid_nodes)
1732 1737
    if node_data == False:
1733 1738
      raise errors.OpExecError("Can't gather the list of OSes")

Also available in: Unified diff