def migrate(*args, **kwargs): """ Migrate qpid queues: - Ensure pulp.task is no longer *exclusive*. - Rename agent queues: consumer_id> => pulp.agent.<consumer_id> """ transport = pulp_conf.get('messaging', 'transport') if transport != 'qpid': # not using qpid return if not QPID_MESSAGING_AVAILABLE: msg = _( 'Migration 0009 did not run because the python package qpid.messaging is not ' 'installed. Pulp\'s Qpid client dependencies can be installed with the ' '\"pulp-server-qpid\" package group. See the installation docs for more ' 'information. Alternatively, you may reconfigure Pulp to use RabbitMQ.' ) _logger.error(msg) raise Exception(msg) if not QPIDTOOLLIBS_AVAILABLE: msg = _( 'Migration 0009 did not run because the python package qpidtoollibs is not ' 'installed. Pulp\'s Qpid client dependencies can be installed with the ' '\"pulp-server-qpid\" package group. See the installation docs for more ' 'information. Alternatively, you may reconfigure Pulp to use RabbitMQ.' ) _logger.error(msg) raise Exception(msg) url = urlparse(pulp_conf.get('messaging', 'url')) connection = Connection(host=url.hostname, port=url.port, transport=url.scheme, reconnect=False, ssl_certfile=pulp_conf.get('messaging', 'clientcert'), ssl_skip_hostname_check=True) connection.attach() broker = BrokerAgent(connection) _migrate_reply_queue(broker) _migrate_agent_queues(broker) connection.detach()
def migrate(*args, **kwargs): """ Migrate qpid queues: - Ensure pulp.task is no longer *exclusive*. - Rename agent queues: consumer_id> => pulp.agent.<consumer_id> """ transport = pulp_conf.get('messaging', 'transport') if transport != 'qpid': # not using qpid return if not QPID_MESSAGING_AVAILABLE: msg = _( 'Migration 0009 did not run because the python package qpid.messaging is not ' 'installed. Please install qpid.messaging and rerun the migrations. See %s' 'for more information.') msg = msg % QPID_MESSAGING_URL _logger.error(msg) raise Exception(msg) if not QPIDTOOLLIBS_AVAILABLE: msg = _( 'Migration 0009 did not run because the python package qpidtoollibs is not ' 'installed. Please install qpidtoollibs and rerun the migrations. See %s for more ' 'information.') msg = msg % QPIDTOOLLIBS_URL _logger.error(msg) raise Exception(msg) url = urlparse(pulp_conf.get('messaging', 'url')) connection = Connection(host=url.hostname, port=url.port, transport=url.scheme, reconnect=False, ssl_certfile=pulp_conf.get('messaging', 'clientcert'), ssl_skip_hostname_check=True) connection.attach() broker = BrokerAgent(connection) _migrate_reply_queue(broker) _migrate_agent_queues(broker) connection.detach()
def migrate(*args, **kwargs): """ Migrate qpid queues: - Ensure pulp.task is no longer *exclusive*. - Rename agent queues: consumer_id> => pulp.agent.<consumer_id> """ transport = pulp_conf.get('messaging', 'transport') if transport != 'qpid': # not using qpid return if not QPID_MESSAGING_AVAILABLE: msg = _('Migration 0009 did not run because the python package qpid.messaging is not ' 'installed. Please install qpid.messaging and rerun the migrations. See %s' 'for more information.') msg = msg % QPID_MESSAGING_URL _logger.error(msg) raise Exception(msg) if not QPIDTOOLLIBS_AVAILABLE: msg = _('Migration 0009 did not run because the python package qpidtoollibs is not ' 'installed. Please install qpidtoollibs and rerun the migrations. See %s for more ' 'information.') msg = msg % QPIDTOOLLIBS_URL _logger.error(msg) raise Exception(msg) url = urlparse(pulp_conf.get('messaging', 'url')) connection = Connection( host=url.hostname, port=url.port, transport=url.scheme, reconnect=False, ssl_certfile=pulp_conf.get('messaging', 'clientcert'), ssl_skip_hostname_check=True) connection.attach() broker = BrokerAgent(connection) _migrate_reply_queue(broker) _migrate_agent_queues(broker) connection.detach()
def migrate(*args, **kwargs): """ Migrate qpid queues: - Ensure pulp.task is no longer *exclusive*. - Rename agent queues: consumer_id> => pulp.agent.<consumer_id> """ transport = pulp_conf.get('messaging', 'transport') if transport != 'qpid': # not using qpid return if not QPID_MESSAGING_AVAILABLE: msg = _('Migration 0009 did not run because the python package qpid.messaging is not ' 'installed. Pulp\'s Qpid client dependencies can be installed with the ' '\"pulp-server-qpid\" package group. See the installation docs for more ' 'information. Alternatively, you may reconfigure Pulp to use RabbitMQ.') _logger.error(msg) raise Exception(msg) if not QPIDTOOLLIBS_AVAILABLE: msg = _('Migration 0009 did not run because the python package qpidtoollibs is not ' 'installed. Pulp\'s Qpid client dependencies can be installed with the ' '\"pulp-server-qpid\" package group. See the installation docs for more ' 'information. Alternatively, you may reconfigure Pulp to use RabbitMQ.') _logger.error(msg) raise Exception(msg) url = urlparse(pulp_conf.get('messaging', 'url')) connection = Connection( host=url.hostname, port=url.port, transport=url.scheme, reconnect=False, ssl_certfile=pulp_conf.get('messaging', 'clientcert'), ssl_skip_hostname_check=True) connection.attach() broker = BrokerAgent(connection) _migrate_reply_queue(broker) _migrate_agent_queues(broker) connection.detach()