コード例 #1
0
ファイル: config_vm.py プロジェクト: lishuo3331/dev_virt
            log.fail(
                "Invalid input memory params, memory size should be smaller than max memory."
            )
            exit(1)
        if max_memory and min_memory and min_memory > max_memory:
            log.fail(
                "Invalid input memory params, min_memory should be smaller than max memory."
            )
            exit(1)

        log.debug("memory_size:%s, min_memory:%s, max_memory:%s", memory_size,
                  min_memory, max_memory)
        if max_memory:
            ret = virthost.config_max_memory(inst_name, static_max=max_memory)
            if not ret:
                log.warning(
                    "Configure max memory size failed, keep same as before...")
        if min_memory:
            ret = virthost.config_min_memory(inst_name, static_min=min_memory)
            if not ret:
                log.warn(
                    "Config min memory size failed, keep same as before...")

        if memory_size:
            if virt_driver.is_instance_running(inst_name):
                ret = virthost.config_memory_lively(inst_name, memory_size)
            elif virt_driver.is_instance_halted(inst_name):
                ret = virthost.config_memory(inst_name,
                                             dynamic_min=memory_size,
                                             dynamic_max=memory_size)
            else:
                log.fail(
コード例 #2
0
thread_log.exception("thread_log test log for exception")

log.info("nohup_orig_log")
nohup_orig_log.debug("test log for debug.")
nohup_orig_log.info("test log for info")
nohup_orig_log.warning("test log for warning")
nohup_orig_log.error("test log for error")
nohup_orig_log.exception("test log for exception")
log.info("nohup log")
nohup_log.debug("nohup test log for debug.")
nohup_log.info("nohup test log for info")
nohup_log.warning("nohup test log for warning")
nohup_log.error("nohup test log for error")
nohup_log.exception("nohup test log for exception")

log.info("rotate_log")
rotate_log.debug("test log for debug.")
rotate_log.info("test log for info")
rotate_log.warning("test log for warning")
rotate_log.error("test log for error")
rotate_log.exception("test log for exception")

log.info("virt console")
log.debug("test log for debug.")
log.info("test log for info")
log.warning("test log for warning")
log.error("test log for error")
log.exception("test log for exception")
log.success("test log for success")
log.fail("test log for fail")