[6]
+ elif exists(join_root_path("proc/cpuinfo")):
+ with open(join_root_path("proc/cpuinfo")) as cpuinfo:
+ if "QEMU Virtual CPU" in cpuinfo.read():
+ virt_info = "kvm"
You don't need to check for the existence of cpuinfo (it should always be there). You can't use "with" because we're still supporting python 2.5 in the client. You could use a future import, but I'd rather see you use try/finally here.
Looks good!
[6] join_root_ path("proc/ cpuinfo" )): root_path( "proc/cpuinfo" )) as cpuinfo:
+ elif exists(
+ with open(join_
+ if "QEMU Virtual CPU" in cpuinfo.read():
+ virt_info = "kvm"
You don't need to check for the existence of cpuinfo (it should always be there). You can't use "with" because we're still supporting python 2.5 in the client. You could use a future import, but I'd rather see you use try/finally here.
+1!