ip.py 文件源码

python
阅读 23 收藏 0 点赞 0 评论 0

项目:charms.openstack 作者: openstack 项目源码 文件源码
def _get_address_override(endpoint_type=PUBLIC):
    """Returns any address overrides that the user has defined based on the
    endpoint type.

    Note: this function allows for the service name to be inserted into the
    address if the user specifies {service_name}.somehost.org.

    :param endpoint_type: the type of endpoint to retrieve the override
                          value for.
    :returns: any endpoint address or hostname that the user has overridden
              or None if an override is not present.
    """
    override_key = ADDRESS_MAP[endpoint_type]['override']
    addr_override = hookenv.config(override_key)
    if not addr_override:
        return None
    else:
        return addr_override.format(service_name=hookenv.service_name())
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号