def postprocess_hostOS_OS(parser): """ postprocess hostOS OS """ if parser["pos_hostOS_shutdown"] == "yes": if mmsh.statehost(parser["HostOS_name"]) != "shutdown": mmsh.stophost(parser["HostOS_name"]) time.sleep(float(parser["pos_hostOS_shutdown_time"])) if mmsh.statehost(parser["HostOS_name"]) != "shutdown": raise TA_error.Postprocess_Error("HostOS can not shutdown")
def shutdown(OS_name): """ shutdown OS return success / [nothing] """ return mmsh.stophost(OS_name)
def postprocess_hostOS_OS(parser): """ postprocess hostOS OS part :called func: postprocess_hostOS :param parser: is a dict, get from Test config file """ if parser["pos_hostOS_shutdown"] == "yes": #若pos_hostOS_shutdown為yes則進入 if mmsh.statehost( parser["PrimaryOS_name"] ) != "shutdown": #詢問mmsh,vm所在host的狀態,若不為shutdown 則進行關機之動作 mmsh.stophost(parser["PrimaryOS_name"]) time.sleep(float(parser["pos_hostOS_shutdown_time"])) if mmsh.statehost(parser["PrimaryOS_name"] ) != "shutdown": #若狀態不為shutdown則raise exception raise TA_error.Postprocess_Error("PrimaryOS can not shutdown")
def shutdown(OS_name): """ shutdown OS :param os_name: host OS name :return: success / [nothing] """ return mmsh.stophost(OS_name)