Revision d8470559 lib/cmdlib.py

b/lib/cmdlib.py
1356 1356
    logger.Info("stopping the node daemon and removing configs from node %s" %
1357 1357
                node.name)
1358 1358

  
1359
    rpc.call_node_leave_cluster(node.name)
1360

  
1361
    logger.Info("Removing node %s from config" % node.name)
1362

  
1363
    self.cfg.RemoveNode(node.name)
1364
    # Remove the node from the Ganeti Lock Manager
1365
    self.context.glm.remove(locking.LEVEL_NODE, node.name)
1359
    self.context.RemoveNode(node.name)
1366 1360

  
1367
    utils.RemoveHostFromEtcHosts(node.name)
1361
    rpc.call_node_leave_cluster(node.name)
1368 1362

  
1369 1363

  
1370 1364
class LUQueryNodes(NoHooksLU):
......
1738 1732
      if not result[node]:
1739 1733
        logger.Error("could not copy file %s to node %s" % (fname, node))
1740 1734

  
1741
    if not self.op.readd:
1742
      logger.Info("adding node %s to cluster.conf" % node)
1743
      self.cfg.AddNode(new_node)
1744
      # Add the new node to the Ganeti Lock Manager
1745
      self.context.glm.add(locking.LEVEL_NODE, node)
1735
    if self.op.readd:
1736
      self.context.ReaddNode(new_node)
1737
    else:
1738
      self.context.AddNode(new_node)
1746 1739

  
1747 1740

  
1748 1741
class LUQueryClusterInfo(NoHooksLU):

Also available in: Unified diff