Connect to RabbitMQ and assign a local attribute

def _connect_to_rabbitmq(self):
        """Connect to RabbitMQ and assign a local attribute"""
        global pending_rabbitmq_connection, rabbitmq_connection
        if not rabbitmq_connection:
            LOGGER.info('Creating a new RabbitMQ connection')
            pending_rabbitmq_connection = self._new_rabbitmq_connection()