本文整理匯總了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()
示例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()
示例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)
示例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()
示例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()
示例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)
示例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)