Revision 90c024f6
b/lib/hypervisor/hv_kvm.py | ||
---|---|---|
167 | 167 |
cmdline = fh.read() |
168 | 168 |
finally: |
169 | 169 |
fh.close() |
170 |
except IOError, err:
|
|
170 |
except EnvironmentError, err:
|
|
171 | 171 |
raise errors.HypervisorError("Failed to list instance %s: %s" % |
172 | 172 |
(instance_name, err)) |
173 | 173 |
|
... | ... | |
266 | 266 |
try: |
267 | 267 |
utils.WriteFile(self._InstanceKVMRuntime(instance_name), |
268 | 268 |
data=data) |
269 |
except IOError, err:
|
|
269 |
except EnvironmentError, err:
|
|
270 | 270 |
raise errors.HypervisorError("Failed to save KVM runtime file: %s" % err) |
271 | 271 |
|
272 | 272 |
def _ReadKVMRuntime(self, instance_name): |
... | ... | |
275 | 275 |
""" |
276 | 276 |
try: |
277 | 277 |
file_content = utils.ReadFile(self._InstanceKVMRuntime(instance_name)) |
278 |
except IOError, err:
|
|
278 |
except EnvironmentError, err:
|
|
279 | 279 |
raise errors.HypervisorError("Failed to load KVM runtime file: %s" % err) |
280 | 280 |
return file_content |
281 | 281 |
|
... | ... | |
535 | 535 |
data = fh.readlines() |
536 | 536 |
finally: |
537 | 537 |
fh.close() |
538 |
except IOError, err:
|
|
538 |
except EnvironmentError, err:
|
|
539 | 539 |
raise errors.HypervisorError("Failed to list node info: %s" % err) |
540 | 540 |
|
541 | 541 |
result = {} |
Also available in: Unified diff