Commit 1e37ad45 authored by Michael Hanselmann's avatar Michael Hanselmann
Browse files

KVM hypervisor: Use ReadFile


Signed-off-by: default avatarMichael Hanselmann <hansmi@google.com>
Reviewed-by: default avatarLuca Bigliardi <shammash@google.com>
parent d73ef63f
......@@ -212,11 +212,7 @@ class KVMHypervisor(hv_base.BaseHypervisor):
cmdline_file = "/proc/%s/cmdline" % pid
try:
fh = open(cmdline_file, 'r')
try:
cmdline = fh.read()
finally:
fh.close()
cmdline = utils.ReadFile(cmdline_file)
except EnvironmentError, err:
raise errors.HypervisorError("Failed to list instance %s: %s" %
(instance_name, err))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment