[pve-devel] applied: [PATCH manager] ui: fix disk controllers sortByPreviousUsage iteration

Thomas Lamprecht t.lamprecht at proxmox.com
Thu Jan 30 13:40:27 CET 2020


Signed-off-by: Thomas Lamprecht <t.lamprecht at proxmox.com>
---
 www/manager6/form/ControllerSelector.js | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/www/manager6/form/ControllerSelector.js b/www/manager6/form/ControllerSelector.js
index e1e9369b..8ba46f17 100644
--- a/www/manager6/form/ControllerSelector.js
+++ b/www/manager6/form/ControllerSelector.js
@@ -8,11 +8,11 @@ Ext.define('PVE.form.ControllerSelector', {
 
     sortByPreviousUsage: function(vmconfig, controllerList) {
 	let usedControllers = {};
-	for (const type of PVE.Utils.diskControllerMaxIDs) {
+	for (const type of Object.keys(PVE.Utils.diskControllerMaxIDs)) {
 	    usedControllers[type] = 0;
 	}
 
-	for (const property of vmconfig) {
+	for (const property of Object.keys(vmconfig)) {
 	    if (property.match(PVE.Utils.bus_match) && !vmconfig[property].match(/media=cdrom/)) {
 		const foundController = property.match(PVE.Utils.bus_match)[1];
 		usedControllers[foundController]++;
-- 
2.20.1





More information about the pve-devel mailing list