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


Python context.ADDRESS_TYPES属性代码示例

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


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

示例1: cluster_joined

# 需要导入模块: from charmhelpers.contrib.openstack import context [as 别名]
# 或者: from charmhelpers.contrib.openstack.context import ADDRESS_TYPES [as 别名]
def cluster_joined(rid=None, ssl_sync_request=True):
    unison.ssh_authorized_peers(user=SSH_USER,
                                group=SSH_USER,
                                peer_interface='cluster',
                                ensure_local_user=True)

    settings = {}

    for addr_type in ADDRESS_TYPES:
        address = get_relation_ip(
            addr_type,
            cidr_network=config('os-{}-network'.format(addr_type)))
        if address:
            settings['{}-address'.format(addr_type)] = address

    settings['private-address'] = get_relation_ip('cluster')

    relation_set(relation_id=rid, relation_settings=settings)

    if ssl_sync_request:
        send_ssl_sync_request() 
开发者ID:openstack,项目名称:charm-keystone,代码行数:23,代码来源:keystone_hooks.py

示例2: cluster_joined

# 需要导入模块: from charmhelpers.contrib.openstack import context [as 别名]
# 或者: from charmhelpers.contrib.openstack.context import ADDRESS_TYPES [as 别名]
def cluster_joined(relation_id=None):
    settings = {}

    for addr_type in ADDRESS_TYPES:
        address = get_relation_ip(
            addr_type,
            cidr_network=config('os-{}-network'.format(addr_type)))
        if address:
            settings['{}-address'.format(addr_type)] = address

    settings['private-address'] = get_relation_ip('cluster')

    relation_set(relation_id=relation_id, relation_settings=settings)

    if not relation_id:
        check_local_db_actions_complete() 
开发者ID:openstack,项目名称:charm-neutron-api,代码行数:18,代码来源:neutron_api_hooks.py

示例3: cluster_joined

# 需要导入模块: from charmhelpers.contrib.openstack import context [as 别名]
# 或者: from charmhelpers.contrib.openstack.context import ADDRESS_TYPES [as 别名]
def cluster_joined(relation_id=None):
    # If this node is the elected leader then share our secret with other nodes
    if is_elected_leader('grp_ceilometer_vips'):
        peer_store('shared_secret', get_shared_secret())

    CONFIGS.write_all()

    settings = {}

    for addr_type in ADDRESS_TYPES:
        address = get_relation_ip(
            addr_type,
            cidr_network=config('os-{}-network'.format(addr_type)))
        if address:
            settings['{}-address'.format(addr_type)] = address

    settings['private-address'] = get_relation_ip('cluster')

    relation_set(relation_id=relation_id, relation_settings=settings) 
开发者ID:openstack,项目名称:charm-ceilometer,代码行数:21,代码来源:ceilometer_hooks.py

示例4: cluster_joined

# 需要导入模块: from charmhelpers.contrib.openstack import context [as 别名]
# 或者: from charmhelpers.contrib.openstack.context import ADDRESS_TYPES [as 别名]
def cluster_joined(rid=None, ssl_sync_request=True):
    unison.ssh_authorized_peers(user=SSH_USER,
                                group='juju_keystone',
                                peer_interface='cluster',
                                ensure_local_user=True)

    settings = {}

    for addr_type in ADDRESS_TYPES:
        address = get_relation_ip(
            addr_type,
            cidr_network=config('os-{}-network'.format(addr_type)))
        if address:
            settings['{}-address'.format(addr_type)] = address

    settings['private-address'] = get_relation_ip('cluster')

    relation_set(relation_id=rid, relation_settings=settings)

    if ssl_sync_request:
        send_ssl_sync_request() 
开发者ID:konono,项目名称:equlipse,代码行数:23,代码来源:keystone_hooks.py

示例5: cluster_joined

# 需要导入模块: from charmhelpers.contrib.openstack import context [as 别名]
# 或者: from charmhelpers.contrib.openstack.context import ADDRESS_TYPES [as 别名]
def cluster_joined(relation_id=None):
    settings = {}

    for addr_type in ADDRESS_TYPES:
        address = get_relation_ip(
            addr_type,
            cidr_network=config('os-{}-network'.format(addr_type)))
        if address:
            settings['{}-address'.format(addr_type)] = address

    settings['private-address'] = get_relation_ip('cluster')

    relation_set(relation_id=relation_id, relation_settings=settings)

    # Only do if this is fired by cluster rel
    if not relation_id:
        check_local_db_actions_complete() 
开发者ID:openstack,项目名称:charm-cinder,代码行数:19,代码来源:cinder_hooks.py

示例6: cluster_joined

# 需要导入模块: from charmhelpers.contrib.openstack import context [as 别名]
# 或者: from charmhelpers.contrib.openstack.context import ADDRESS_TYPES [as 别名]
def cluster_joined(relation_id=None):
    settings = {}

    for addr_type in ADDRESS_TYPES:
        address = get_relation_ip(
            addr_type,
            cidr_network=config('os-{}-network'.format(addr_type)))
        if address:
            settings['{}-address'.format(addr_type)] = address

    settings['private-address'] = get_relation_ip('cluster')

    relation_set(relation_id=relation_id, relation_settings=settings) 
开发者ID:openstack,项目名称:charm-swift-proxy,代码行数:15,代码来源:swift_hooks.py

示例7: cluster_joined

# 需要导入模块: from charmhelpers.contrib.openstack import context [as 别名]
# 或者: from charmhelpers.contrib.openstack.context import ADDRESS_TYPES [as 别名]
def cluster_joined(rid=None):
    settings = {}

    for addr_type in ADDRESS_TYPES:
        address = get_relation_ip(
            addr_type,
            cidr_network=config('os-{}-network'.format(addr_type)))
        if address:
            settings['{}-address'.format(addr_type)] = address

    settings['private-address'] = get_relation_ip('cluster')

    relation_set(relation_id=rid, relation_settings=settings) 
开发者ID:openstack,项目名称:charm-ceph-radosgw,代码行数:15,代码来源:hooks.py


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