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


Python RemoteHelper.terminate_virtualized_cluster方法代码示例

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


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

示例1: terminate_instances

# 需要导入模块: from remote_helper import RemoteHelper [as 别名]
# 或者: from remote_helper.RemoteHelper import terminate_virtualized_cluster [as 别名]
    def terminate_instances(cls, options):
        """Stops all services running in an AppScale deployment, and in cloud
    deployments, also powers off the instances previously spawned.

    Raises:
      AppScaleException: If AppScale is not running, and thus can't be
      terminated.
    """
        if not os.path.exists(LocalState.get_secret_key_location(options.keyname)):
            raise AppScaleException("AppScale is not running with the keyname {0}".format(options.keyname))

        infrastructure = LocalState.get_infrastructure(options.keyname)

        # If the user is on a cloud deployment, and not backing their data to
        # persistent disks, warn them before shutting down AppScale.
        # Also, if we're in developer mode, skip the warning.
        if infrastructure != "xen" and not LocalState.are_disks_used(options.keyname) and not options.test:
            LocalState.ensure_user_wants_to_terminate()

        if infrastructure in InfrastructureAgentFactory.VALID_AGENTS:
            RemoteHelper.terminate_cloud_infrastructure(options.keyname, options.verbose)
        else:
            RemoteHelper.terminate_virtualized_cluster(options.keyname, options.verbose)

        LocalState.cleanup_appscale_files(options.keyname)
        AppScaleLogger.success("Successfully shut down your AppScale deployment.")
开发者ID:lmandres,项目名称:appscale-tools-raspberry-pi,代码行数:28,代码来源:appscale_tools.py

示例2: terminate_instances

# 需要导入模块: from remote_helper import RemoteHelper [as 别名]
# 或者: from remote_helper.RemoteHelper import terminate_virtualized_cluster [as 别名]
    def terminate_instances(cls, options):
        """Stops all services running in an AppScale deployment, and in cloud
    deployments, also powers off the instances previously spawned.

    Raises:
      AppScaleException: If AppScale is not running, and thus can't be
      terminated.
    """
        try:
            infrastructure = LocalState.get_infrastructure(options.keyname)
        except IOError:
            raise AppScaleException("Cannot find AppScale's configuration for keyname {0}".format(options.keyname))

        if infrastructure == "xen" and options.terminate:
            raise AppScaleException("Terminate option is invalid for cluster mode.")

        if infrastructure == "xen" or not options.terminate:
            # We are in cluster mode: let's check if AppScale is running.
            if not os.path.exists(LocalState.get_secret_key_location(options.keyname)):
                raise AppScaleException("AppScale is not running with the keyname {0}".format(options.keyname))

        # Stop gracefully the AppScale deployment.
        try:
            RemoteHelper.terminate_virtualized_cluster(options.keyname, options.verbose)
        except (IOError, AppScaleException):
            # Don't fail if we cannot find the configuration.
            pass

        # And if we are on a cloud infrastructure, terminate instances if
        # asked.
        if infrastructure in InfrastructureAgentFactory.VALID_AGENTS and options.terminate:
            RemoteHelper.terminate_cloud_infrastructure(options.keyname, options.verbose)
开发者ID:AppScale,项目名称:appscale-tools,代码行数:34,代码来源:appscale_tools.py

示例3: terminate_instances

# 需要导入模块: from remote_helper import RemoteHelper [as 别名]
# 或者: from remote_helper.RemoteHelper import terminate_virtualized_cluster [as 别名]
  def terminate_instances(cls, options):
    """Stops all services running in an AppScale deployment, and in cloud
    deployments, also powers off the instances previously spawned.

    Raises:
      AppScaleException: If AppScale is not running, and thus can't be
      terminated.
    """
    if not os.path.exists(LocalState.get_locations_yaml_location(
      options.keyname)):
      raise AppScaleException("AppScale is not running with the keyname {0}".
        format(options.keyname))

    if LocalState.get_infrastructure(options.keyname) in \
      InfrastructureAgentFactory.VALID_AGENTS:
      RemoteHelper.terminate_cloud_infrastructure(options.keyname,
        options.verbose)
    else:
      RemoteHelper.terminate_virtualized_cluster(options.keyname,
        options.verbose)

    LocalState.cleanup_appscale_files(options.keyname)
    AppScaleLogger.success("Successfully shut down your AppScale deployment.")
开发者ID:DrOctogon,项目名称:appscale-tools,代码行数:25,代码来源:appscale_tools.py


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