From 90c024f654180cae53ac80dd219669e9a7b154c8 Mon Sep 17 00:00:00 2001 From: Guido Trotter <ultrotter@google.com> Date: Wed, 21 Jan 2009 18:23:29 +0000 Subject: [PATCH] KVM: change a few IOError with EnvironmentError Reviewed-by: iustinp --- lib/hypervisor/hv_kvm.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/hypervisor/hv_kvm.py b/lib/hypervisor/hv_kvm.py index e2a13eef9..ba5b39d2d 100644 --- a/lib/hypervisor/hv_kvm.py +++ b/lib/hypervisor/hv_kvm.py @@ -167,7 +167,7 @@ class KVMHypervisor(hv_base.BaseHypervisor): cmdline = fh.read() finally: fh.close() - except IOError, err: + except EnvironmentError, err: raise errors.HypervisorError("Failed to list instance %s: %s" % (instance_name, err)) @@ -266,7 +266,7 @@ class KVMHypervisor(hv_base.BaseHypervisor): try: utils.WriteFile(self._InstanceKVMRuntime(instance_name), data=data) - except IOError, err: + except EnvironmentError, err: raise errors.HypervisorError("Failed to save KVM runtime file: %s" % err) def _ReadKVMRuntime(self, instance_name): @@ -275,7 +275,7 @@ class KVMHypervisor(hv_base.BaseHypervisor): """ try: file_content = utils.ReadFile(self._InstanceKVMRuntime(instance_name)) - except IOError, err: + except EnvironmentError, err: raise errors.HypervisorError("Failed to load KVM runtime file: %s" % err) return file_content @@ -535,7 +535,7 @@ class KVMHypervisor(hv_base.BaseHypervisor): data = fh.readlines() finally: fh.close() - except IOError, err: + except EnvironmentError, err: raise errors.HypervisorError("Failed to list node info: %s" % err) result = {} -- GitLab