当前位置: 首页>>代码示例>>Python>>正文


Python Connection.detach方法代码示例

本文整理汇总了Python中qpid.messaging.Connection.detach方法的典型用法代码示例。如果您正苦于以下问题:Python Connection.detach方法的具体用法?Python Connection.detach怎么用?Python Connection.detach使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在qpid.messaging.Connection的用法示例。


在下文中一共展示了Connection.detach方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: migrate

# 需要导入模块: from qpid.messaging import Connection [as 别名]
# 或者: from qpid.messaging.Connection import detach [as 别名]
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()
开发者ID:AndreaGiardini,项目名称:pulp,代码行数:43,代码来源:0009_qpid_queues.py

示例2: migrate

# 需要导入模块: from qpid.messaging import Connection [as 别名]
# 或者: from qpid.messaging.Connection import detach [as 别名]
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()
开发者ID:BrnoPCmaniak,项目名称:pulp,代码行数:43,代码来源:0009_qpid_queues.py


注:本文中的qpid.messaging.Connection.detach方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。