當前位置: 首頁>>代碼示例>>Python>>正文


Python CloudHost.log_error方法代碼示例

本文整理匯總了Python中cloud.aws.CloudHost.log_error方法的典型用法代碼示例。如果您正苦於以下問題:Python CloudHost.log_error方法的具體用法?Python CloudHost.log_error怎麽用?Python CloudHost.log_error使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在cloud.aws.CloudHost的用法示例。


在下文中一共展示了CloudHost.log_error方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: do_housekeeping

# 需要導入模塊: from cloud.aws import CloudHost [as 別名]
# 或者: from cloud.aws.CloudHost import log_error [as 別名]
    def do_housekeeping():
        JBox.do_update_user_home_image()

        server_delete_timeout = JBox.cfg['expire']
        JBoxContainer.maintain(max_timeout=server_delete_timeout, inactive_timeout=JBox.cfg['inactivity_timeout'],
                               protected_names=JBox.cfg['protected_docknames'])
        if JBox.cfg['cloud_host']['scale_down'] and (JBoxContainer.num_active() == 0) and \
                (JBoxContainer.num_stopped() == 0) and CloudHost.should_terminate():
            JBox.log_info("terminating to scale down")
            try:
                CloudHost.deregister_instance_dns()
            except:
                CloudHost.log_error("Error deregistering instance dns")
            CloudHost.terminate_instance()
        elif is_cluster_leader():
            CloudHost.log_info("I am the cluster leader")
            JBox.monitor_registrations()
            if not JBoxDynConfig.is_stat_collected_within(CloudHost.INSTALL_ID, 7):
                JBoxContainer.async_collect_stats()
開發者ID:melvin0008,項目名稱:JuliaBox,代碼行數:21,代碼來源:jbox.py

示例2: do_housekeeping

# 需要導入模塊: from cloud.aws import CloudHost [as 別名]
# 或者: from cloud.aws.CloudHost import log_error [as 別名]
    def do_housekeeping():
        terminating = False
        server_delete_timeout = JBox.cfg['expire']
        JBoxContainer.maintain(max_timeout=server_delete_timeout, inactive_timeout=JBox.cfg['inactivity_timeout'],
                               protected_names=JBox.cfg['protected_docknames'])
        if is_cluster_leader():
            CloudHost.log_info("I am the cluster leader")
            JBox.monitor_registrations()
            if not JBoxDynConfig.is_stat_collected_within(CloudHost.INSTALL_ID, 1):
                JBoxContainer.async_collect_stats()
            JBoxContainer.async_update_disk_state()
        elif JBox.is_ready_to_terminate():
            terminating = True
            JBox.log_warn("terminating to scale down")
            try:
                CloudHost.deregister_instance_dns()
            except:
                CloudHost.log_error("Error deregistering instance dns")
            CloudHost.terminate_instance()

        if not terminating:
            JBox.do_update_user_home_image()
開發者ID:barrygolden,項目名稱:JuliaBox,代碼行數:24,代碼來源:jbox.py


注:本文中的cloud.aws.CloudHost.log_error方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。