openstack.py 文件源码

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

项目:cumin 作者: wikimedia 项目源码 文件源码
def _get_keystone_session(config, project=None):
    """Return a new keystone session based on configuration.

    Arguments:
        config (dict): a dictionary with the session configuration keys: ``auth_url``, ``username``, ``password``.
        project (str, optional): a project to scope the session to.

    Returns:
        keystoneauth1.session.Session: the Keystone session scoped for the project if specified.

    """
    auth = keystone_identity.Password(
        auth_url='{auth_url}/v3'.format(auth_url=config.get('auth_url', 'http://localhost:5000')),
        username=config.get('username', 'username'),
        password=config.get('password', 'password'),
        project_name=project,
        user_domain_id='default',
        project_domain_id='default')
    return keystone_session.Session(auth=auth)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号