当前位置: 首页>>代码示例>>Python>>正文


Python RemoteHelper.get_host_appscale_version方法代码示例

本文整理汇总了Python中remote_helper.RemoteHelper.get_host_appscale_version方法的典型用法代码示例。如果您正苦于以下问题:Python RemoteHelper.get_host_appscale_version方法的具体用法?Python RemoteHelper.get_host_appscale_version怎么用?Python RemoteHelper.get_host_appscale_version使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在remote_helper.RemoteHelper的用法示例。


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

示例1: upgrade

# 需要导入模块: from remote_helper import RemoteHelper [as 别名]
# 或者: from remote_helper.RemoteHelper import get_host_appscale_version [as 别名]
    def upgrade(cls, options):
        """ Upgrades the deployment to the latest AppScale version.
    Args:
      options: A Namespace that has fields for each parameter that can be
        passed in via the command-line interface.
    """
        node_layout = NodeLayout(options)
        if not node_layout.is_valid():
            raise BadConfigurationException("Your ips_layout is invalid:\n{}".format(node_layout.errors()))

        latest_tools = APPSCALE_VERSION
        try:
            AppScaleLogger.log("Checking if an update is available for appscale-tools")
            latest_tools = latest_tools_version()
        except:
            # Prompt the user if version metadata can't be fetched.
            if not options.test:
                response = raw_input(
                    "Unable to check for the latest version of appscale-tools. Would "
                    "you like to continue upgrading anyway? (y/N) "
                )
                if response.lower() not in ["y", "yes"]:
                    raise AppScaleException("Cancelled AppScale upgrade.")

        if latest_tools > APPSCALE_VERSION:
            raise AppScaleException(
                "There is a newer version ({}) of appscale-tools available. Please "
                "upgrade the tools package before running 'appscale upgrade'.".format(latest_tools)
            )

        master_ip = node_layout.head_node().public_ip
        upgrade_version_available = cls.get_upgrade_version_available()

        current_version = RemoteHelper.get_host_appscale_version(master_ip, options.keyname, options.verbose)

        # Don't run bootstrap if current version is later that the most recent
        # public one. Covers cases of revoked versions/tags and ensures we won't
        # try to downgrade the code.
        if current_version >= upgrade_version_available:
            AppScaleLogger.log("AppScale is already up to date. Skipping code upgrade.")
            AppScaleLogger.log("Running upgrade script to check if any other upgrades are needed.")
            cls.shut_down_appscale_if_running(options)
            cls.run_upgrade_script(options, node_layout)
            return

        cls.shut_down_appscale_if_running(options)
        cls.upgrade_appscale(options, node_layout)
开发者ID:AppScale,项目名称:appscale-tools,代码行数:49,代码来源:appscale_tools.py


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