(self, old_name, new_name)
Rename node.
Rename node.
Rename node .
def cmd_rename_node(self, old_name, new_name):
        """Rename node."""

        self.load_local_info()

        root_db = self.find_root_db()

        # pause target node
        self.pause_node(old_name)
        node = self.load_node_info(old_name)
        provider_node = node.provider_node
        subscriber_list = self.get_node_subscriber_list(old_name)

        # create copy of member info / subscriber+queue info
        step1 = 'select * from pgq_node.rename_node_step1(%s, %s, %s)'
        # rename node itself, drop copies
        step2 = 'select * from pgq_node.rename_node_step2(%s, %s, %s)'

        # step1
        self.exec_cmd(root_db, step1, [self.queue_name, old_name, new_name])
        self.node_cmd(provider_node, step1, [self.queue_name, old_name, new_name])
        self.node_cmd(old_name, step1, [self.queue_name, old_name, new_name])
        for child in subscriber_list:
            self.node_cmd(child, step1, [self.queue_name, old_name, new_name])

        # step1
        self.node_cmd(old_name, step2, [self.queue_name, old_name, new_name])
        self.node_cmd(provider_node, step1, [self.queue_name, old_name, new_name])
        for child in subscriber_list:
            self.node_cmd(child, step2, [self.queue_name, old_name, new_name])
        self.exec_cmd(root_db, step2, [self.queue_name, old_name, new_name])

        # resume node
        self.resume_node(old_name)
def cmd_rename_node ( self , old_name , new_name ) : self . load_local_info ( ) root_db = self . find_root_db ( ) # pause target node self . pause_node ( old_name ) node = self . load_node_info ( old_name ) provider_node = node . provider_node subscriber_list = self . get_node_subscriber_list ( old_name ) # create copy of member info / subscriber+queue info step1 = 'select * from pgq_node.rename_node_step1(%s, %s, %s)' # rename node itself, drop copies step2 = 'select * from pgq_node.rename_node_step2(%s, %s, %s)' # step1 self . exec_cmd ( root_db , step1 , [ self . queue_name , old_name , new_name ] ) self . node_cmd ( provider_node , step1 , [ self . queue_name , old_name , new_name ] ) self . node_cmd ( old_name , step1 , [ self . queue_name , old_name , new_name ] ) for child in subscriber_list : self . node_cmd ( child , step1 , [ self . queue_name , old_name , new_name ] ) # step1 self . node_cmd ( old_name , step2 , [ self . queue_name , old_name , new_name ] ) self . node_cmd ( provider_node , step1 , [ self . queue_name , old_name , new_name ] ) for child in subscriber_list : self . node_cmd ( child , step2 , [ self . queue_name , old_name , new_name ] ) self . exec_cmd ( root_db , step2 , [ self . queue_name , old_name , new_name ] ) # resume node self . resume_node ( old_name )