account.py 文件源码

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

项目:cli 作者: riseml 项目源码 文件源码
def run_register(args):
    api_client = ApiClient()
    client = AdminApi(api_client)
    account = call_api(lambda: client.get_account_info())
    if account.key is not None:
        print('Note: this cluster is already registered with an account. '
              'You can continue and register with another account.')
        read_and_register_account_key()
    else:
        key_exists = read_yes_no('Do you already have an account key')
        if key_exists:
            read_and_register_account_key()
        else:
            register_url = get_riseml_url() + 'register/basic/%s' % account.cluster_id
            if browser_available():
                webbrowser.open_new_tab(register_url)
            else:
                print('Please visit this URL and follow instructions'
                    ' to register an account: %s' % register_url)
            read_and_register_account_key()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号