The new Env object is backward compatible with the regular env dict, so all the kvm_utils.env_*() functions should work as usual. Signed-off-by: Eduardo Habkost <ehabkost@xxxxxxxxxxx> --- client/tests/kvm/kvm.py | 10 +++++----- client/tests/kvm/kvm_scheduler.py | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/client/tests/kvm/kvm.py b/client/tests/kvm/kvm.py index ceee88f..9d942d3 100644 --- a/client/tests/kvm/kvm.py +++ b/client/tests/kvm/kvm.py @@ -43,7 +43,7 @@ class kvm(test.test): logging.info("Unpickling env. You may see some harmless error " "messages.") env_filename = os.path.join(self.bindir, params.get("env", "env")) - env = kvm_utils.load_env(env_filename, self.env_version) + env = kvm_utils.Env(env_filename, self.env_version) test_passed = False @@ -68,13 +68,13 @@ class kvm(test.test): try: kvm_preprocessing.preprocess(self, params, env) finally: - kvm_utils.dump_env(env, env_filename) + env.save() # Run the test function run_func = getattr(test_module, "run_%s" % t_type) try: run_func(self, params, env) finally: - kvm_utils.dump_env(env, env_filename) + env.save() test_passed = True except Exception, e: @@ -85,7 +85,7 @@ class kvm(test.test): kvm_preprocessing.postprocess_on_error( self, params, env) finally: - kvm_utils.dump_env(env, env_filename) + env.save() raise finally: @@ -99,7 +99,7 @@ class kvm(test.test): logging.error("Exception raised during " "postprocessing: %s", e) finally: - kvm_utils.dump_env(env, env_filename) + env.save() except Exception, e: if params.get("abort_on_error") != "yes": diff --git a/client/tests/kvm/kvm_scheduler.py b/client/tests/kvm/kvm_scheduler.py index aa581ad..95282e4 100644 --- a/client/tests/kvm/kvm_scheduler.py +++ b/client/tests/kvm/kvm_scheduler.py @@ -74,13 +74,13 @@ class scheduler: # The scheduler wants this worker to free its used resources elif cmd[0] == "cleanup": env_filename = os.path.join(self.bindir, self_dict["env"]) - env = kvm_utils.load_env(env_filename, {}) + env = kvm_utils.Env(env_filename) for obj in env.values(): if isinstance(obj, kvm_vm.VM): obj.destroy() elif isinstance(obj, kvm_subprocess.Spawn): obj.close() - kvm_utils.dump_env(env, env_filename) + env.save() w.write("cleanup_done\n") w.write("ready\n") -- 1.7.3.4 -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html