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


Python CloudHost.log_info方法代码示例

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


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

示例1: run

# 需要导入模块: from cloud.aws import CloudHost [as 别名]
# 或者: from cloud.aws.CloudHost import log_info [as 别名]
 def run(self):
     try:
         CloudHost.deregister_instance_dns()
     except:
         CloudHost.log_info("No prior dns registration found for the instance")
     CloudHost.register_instance_dns()
     JBoxContainer.publish_container_stats()
     JBox.do_update_user_home_image()
     JBoxContainer.async_refresh_disks()
     self.ct.start()
     self.ioloop.start()
开发者ID:melvin0008,项目名称:JuliaBox,代码行数:13,代码来源:jbox.py

示例2: monitor_registrations

# 需要导入模块: from cloud.aws import CloudHost [as 别名]
# 或者: from cloud.aws.CloudHost import log_info [as 别名]
    def monitor_registrations():
        max_rate = JBoxDynConfig.get_registration_hourly_rate(CloudHost.INSTALL_ID)
        rate = JBoxUserV2.count_created(1)
        reg_allowed = JBoxDynConfig.get_allow_registration(CloudHost.INSTALL_ID)
        CloudHost.log_debug("registration allowed: %r, rate: %d, max allowed: %d", reg_allowed, rate, max_rate)

        if (reg_allowed and (rate > max_rate*1.1)) or ((not reg_allowed) and (rate < max_rate*0.9)):
            reg_allowed = not reg_allowed
            CloudHost.log_warn("Changing registration allowed to %r", reg_allowed)
            JBoxDynConfig.set_allow_registration(CloudHost.INSTALL_ID, reg_allowed)

        if reg_allowed:
            num_pending_activations = JBoxUserV2.count_pending_activations()
            if num_pending_activations > 0:
                CloudHost.log_info("scheduling activations for %d pending activations", num_pending_activations)
                JBoxContainer.async_schedule_activations()
开发者ID:barrygolden,项目名称:JuliaBox,代码行数:18,代码来源:jbox.py

示例3: do_housekeeping

# 需要导入模块: from cloud.aws import CloudHost [as 别名]
# 或者: from cloud.aws.CloudHost import log_info [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

示例4: do_housekeeping

# 需要导入模块: from cloud.aws import CloudHost [as 别名]
# 或者: from cloud.aws.CloudHost import log_info [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_info方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。