fix(VM): cpuCap can be defined when cpuWeight is not

This commit is contained in:
Julien Fontanet 2016-07-19 15:37:07 +02:00
parent 7d993e8319
commit 47d7561db4

View File

@ -335,9 +335,10 @@ const TRANSFORMS = {
}
}
if (obj.VCPUs_params && obj.VCPUs_params.weight) {
vm.cpuCap = obj.VCPUs_params.cap
vm.cpuWeight = obj.VCPUs_params.weight
let tmp
if ((tmp = obj.VCPUs_params)) {
tmp.cap && (vm.cpuCap = tmp.cap)
tmp.weight && (vm.cpuWeight = tmp.weight)
}
if (!isHvm) {