def postprocess_image(test, params): """ Postprocess a single QEMU image according to the instructions in params. @param test: An Autotest test object. @param params: A dict containing image postprocessing parameters. """ if params.get("check_image") == "yes": virt_vm.check_image(params, test.bindir) if params.get("remove_image") == "yes": virt_vm.remove_image(params, test.bindir)
def postprocess_image(test, params): """ Postprocess a single QEMU image according to the instructions in params. @param test: An Autotest test object. @param params: A dict containing image postprocessing parameters. """ if params.get("check_image") == "yes": try: virt_vm.check_image(params, test.bindir) except Exception, e: if params.get("restore_image_on_check_error", "no") == "yes": virt_vm.backup_image(params, test.bindir, 'restore', True) raise e if params.get("remove_image") == "yes": virt_vm.remove_image(params, test.bindir) def postprocess_vm(test, params, env, name): """ Postprocess a single VM object according to the instructions in params. Kill the VM if requested and get a screendump. @param test: An Autotest test object. @param params: A dict containing VM postprocessing parameters. @param env: The environment (a dict-like object). @param name: The name of the VM object. """ logging.debug("Postprocessing VM '%s'" % name) vm = env.get_vm(name) if not vm: