om_manager.py 文件源码

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

项目:aws-pcf-quickstart 作者: cf-platform-eng 项目源码 文件源码
def stage_product(product_name: str, my_settings: settings.Settings):
    cmd = "{om_with_auth} curl --path /api/v0/available_products".format(
        om_with_auth=get_om_with_auth(my_settings)
    )
    p = Popen(cmd, stdout=PIPE, stderr=PIPE, shell=True)
    out, err = p.communicate()
    if p.returncode != 0:
        print("Failed to query api")
        return out, err, p.returncode

    products = json.loads(out.decode())
    cf_version = [x['product_version'] for x in products if x['name'] == product_name][0]

    # ok to call multiple times, no-op when already staged
    cmd = "{om_with_auth} stage-product -p {product_name} -v {version}".format(
        om_with_auth=get_om_with_auth(my_settings),
        product_name=product_name,
        version=cf_version
    )
    return util.exponential_backoff_cmd(cmd)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号