(self, node_name)
Drop a node.
Drop a node.
Drop a node .
def cmd_drop_node(self, node_name):
        """Drop a node."""

        self.load_local_info()

        node = None
        try:
            node = self.load_node_info(node_name)
            if node:
                # see if we can safely drop
                subscriber_list = self.get_node_subscriber_list(node_name)
                if subscriber_list:
                    raise UsageError('node still has subscribers')
        except skytools.DBError:
            pass

        try:
            # unregister node location from root node (event will be added to queue)
            if node and node.type == 'root':
                pass
            else:
                root_db = self.find_root_db()
                q = "select * from pgq_node.unregister_location(%s, %s)"
                self.exec_cmd(root_db, q, [self.queue_name, node_name])
        except skytools.DBError, d:
            self.log.warning("Unregister from root failed: %s", str(d))

        try:
            # drop node info
            db = self.get_node_database(node_name)
            q = "select * from pgq_node.drop_node(%s, %s)"
            self.exec_cmd(db, q, [self.queue_name, node_name])
        except skytools.DBError, d:
            self.log.warning("Local drop failure: %s", str(d))

        # brute force removal
        for n in self.queue_info.member_map.values():
            try:
                q = "select * from pgq_node.drop_node(%s, %s)"
                self.node_cmd(n.name, q, [self.queue_name, node_name])
            except skytools.DBError, d:
                self.log.warning("Failed to remove from '%s': %s", n.name, str(d))
def cmd_drop_node ( self , node_name ) : self . load_local_info ( ) node = None try : node = self . load_node_info ( node_name ) if node : # see if we can safely drop subscriber_list = self . get_node_subscriber_list ( node_name ) if subscriber_list : raise UsageError ( 'node still has subscribers' ) except skytools . DBError : pass try : # unregister node location from root node (event will be added to queue) if node and node . type == 'root' : pass else : root_db = self . find_root_db ( ) q = "select * from pgq_node.unregister_location(%s, %s)" self . exec_cmd ( root_db , q , [ self . queue_name , node_name ] ) except skytools . DBError , d : self . log . warning ( "Unregister from root failed: %s" , str ( d ) ) try : # drop node info db = self . get_node_database ( node_name ) q = "select * from pgq_node.drop_node(%s, %s)" self . exec_cmd ( db , q , [ self . queue_name , node_name ] ) except skytools . DBError , d : self . log . warning ( "Local drop failure: %s" , str ( d ) ) # brute force removal for n in self . queue_info . member_map . values ( ) : try : q = "select * from pgq_node.drop_node(%s, %s)" self . node_cmd ( n . name , q , [ self . queue_name , node_name ] ) except skytools . DBError , d : self . log . warning ( "Failed to remove from '%s': %s" , n . name , str ( d ) )