• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python fileutils.update_globals_file函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中rally.common.fileutils.update_globals_file函数的典型用法代码示例。如果您正苦于以下问题:Python update_globals_file函数的具体用法?Python update_globals_file怎么用?Python update_globals_file使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了update_globals_file函数的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: use

    def use(self, api, deployment):
        """Set active deployment."""
        # TODO(astudenov): make this method platform independent
        try:
            if not isinstance(deployment, dict):
                deployment = api.deployment.get(deployment=deployment)
        except exceptions.DBRecordNotFound:
            print("Deployment %s is not found." % deployment)
            return 1
        print("Using deployment: %s" % deployment["uuid"])

        fileutils.update_globals_file(envutils.ENV_DEPLOYMENT,
                                      deployment["uuid"])
        fileutils.update_globals_file(envutils.ENV_ENV,
                                      deployment["uuid"])

        if "openstack" in deployment["credentials"]:
            creds = deployment["credentials"]["openstack"][0]
            self._update_openrc_deployment_file(
                deployment["uuid"], creds["admin"] or creds["users"][0])
            print("~/.rally/openrc was updated\n\nHINTS:\n"
                  "\n* To use standard OpenStack clients, set up your env by "
                  "running:\n\tsource ~/.rally/openrc\n"
                  "  OpenStack clients are now configured, e.g run:\n\t"
                  "openstack image list")
开发者ID:jacobwagner,项目名称:rally,代码行数:25,代码来源:deployment.py


示例2: use_verifier

 def use_verifier(self, api, verifier_id):
     """Choose a verifier to use for the future operations."""
     verifier = api.verifier.get(verifier_id=verifier_id)
     fileutils.update_globals_file(envutils.ENV_VERIFIER, verifier["uuid"])
     print("Using verifier '%s' (UUID=%s) as the default verifier "
           "for the future CLI operations."
           % (verifier["name"], verifier["uuid"]))
开发者ID:andreykurilin,项目名称:rally,代码行数:7,代码来源:verify.py


示例3: use

    def use(self, task_id):
        """Set active task.

        :param task_id: Task uuid.
        """
        print("Using task: %s" % task_id)
        api.Task.get(task_id)
        fileutils.update_globals_file("RALLY_TASK", task_id)
开发者ID:hmdesai89,项目名称:rally,代码行数:8,代码来源:task.py


示例4: use

    def use(self, task):
        """Set active task. Alias for "rally use task".

        :param task: Task uuid.
        """
        print("Using task: %s" % task)
        db.task_get(task)
        fileutils.update_globals_file("RALLY_TASK", task)
开发者ID:esikachev,项目名称:rally,代码行数:8,代码来源:task.py


示例5: use

    def use(self, verification):
        """Set active verification.

        :param verification: a UUID of verification
        """
        print("Verification UUID: %s" % verification)
        api.Verification.get(verification)
        fileutils.update_globals_file("RALLY_VERIFICATION", verification)
开发者ID:rvbaz,项目名称:rally,代码行数:8,代码来源:verify.py


示例6: use

    def use(self, verification):
        """Set active verification. Alias for "rally use verification"

        :param verification: a UUID of verification
        """
        print("Verification UUID: %s" % verification)
        db.verification_get(verification)
        fileutils.update_globals_file("RALLY_VERIFICATION", verification)
开发者ID:plomakin,项目名称:rally,代码行数:8,代码来源:verify.py


示例7: use

    def use(self, api, verification_uuid):
        """Choose a verification to use for the future operations."""

        verification = api.verification.get(
            verification_uuid=verification_uuid)
        fileutils.update_globals_file(
            envutils.ENV_VERIFICATION, verification["uuid"])
        print("Using verification (UUID=%s) as the default verification "
              "for the future operations." % verification["uuid"])
开发者ID:andreykurilin,项目名称:rally,代码行数:9,代码来源:verify.py


示例8: setup

def setup(): 
    if CONF.profile:
        profile = CONF.profile
    else:
        profile = envutils.get_global("RALLY_PROFILE")
        if profile == None:
            profile = PROFILE_OPENSTACK
            
    if not profile in PROFILE_ALL_LIST:
        raise InvalidArgumentsException("Unknown profile %s" % profile)
    
    fileutils.update_globals_file("RALLY_PROFILE", profile)
    
    print("Using profile: %s" % profile)    
开发者ID:huikang,项目名称:rally,代码行数:14,代码来源:profile.py


示例9: use

    def use(self, deployment):
        """Set active deployment.

        :param deployment: UUID or name of the deployment
        """
        try:
            deployment = api.Deployment.get(deployment)
            print("Using deployment: %s" % deployment["uuid"])

            fileutils.update_globals_file("RALLY_DEPLOYMENT",
                                          deployment["uuid"])

        except exceptions.DeploymentNotFound:
            print("Deployment %s is not found." % deployment)
            return 1
开发者ID:flavio-fernandes,项目名称:ovn-scale-test,代码行数:15,代码来源:deployment.py


示例10: use

    def use(self, deployment):
        """Set active deployment. Alias for "rally use deployment".

        :param deployment: UUID or name of a deployment
        """
        try:
            deployment = db.deployment_get(deployment)
            print("Using deployment: %s" % deployment["uuid"])
            fileutils.update_globals_file("RALLY_DEPLOYMENT",
                                          deployment["uuid"])
            self._update_openrc_deployment_file(
                deployment["uuid"], deployment.get("admin") or
                deployment.get("users")[0])
            print ("~/.rally/openrc was updated\n\nHINTS:\n"
                   "* To get your cloud resources, run:\n\t"
                   "rally show [flavors|images|keypairs|networks|secgroups]\n"
                   "\n* To use standard OpenStack clients, set up your env by "
                   "running:\n\tsource ~/.rally/openrc\n"
                   "  OpenStack clients are now configured, e.g run:\n\t"
                   "glance image-list")
        except exceptions.DeploymentNotFound:
            print("Deployment %s is not found." % deployment)
            return 1
开发者ID:briandowns,项目名称:rally,代码行数:23,代码来源:deployment.py


示例11: _use

 def _use(self, env_uuid, to_json):
     _print("Using environment: %s" % env_uuid, to_json)
     fileutils.update_globals_file(envutils.ENV_ENV, env_uuid)
开发者ID:jacobwagner,项目名称:rally,代码行数:3,代码来源:env.py


示例12: use

    def use(self, api, task_id):
        """Set active task."""

        print("Using task: %s" % task_id)
        api.task.get(task_id=task_id)
        fileutils.update_globals_file("RALLY_TASK", task_id)
开发者ID:jacobwagner,项目名称:rally,代码行数:6,代码来源:task.py



注:本文中的rally.common.fileutils.update_globals_file函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python i18n._函数代码示例发布时间:2022-05-26
下一篇:
Python db.deployment_get函数代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap