當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。