[pve-devel] [PATCH manager 1/2] fix #2340: gui: ceph: handle 'null' versions for hosts

Dominik Csapak d.csapak at proxmox.com
Thu Aug 22 12:26:09 CEST 2019


the api returns 'null' for a host that is in the crushmap, but
without actual version information, so just check for falsyness instead
of 'undefined', else we run later into javascript exceptions and no
content on the osd page

Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
---
i am not so sure if the api return 'null' is a bug too, but this change
here is easy and does the right thing also

we can also change the 'compare_ceph_version' method so that it
can properly handle undefined and null values, if wanted

 www/manager6/ceph/OSD.js | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/www/manager6/ceph/OSD.js b/www/manager6/ceph/OSD.js
index ed1b660c..24f6f9d6 100644
--- a/www/manager6/ceph/OSD.js
+++ b/www/manager6/ceph/OSD.js
@@ -311,7 +311,7 @@ Ext.define('PVE.node.CephOsdTree', {
 		    };
 		    traverse(data.root, node => {
 			// compatibility for old api call
-			if (node.type === 'host' && node.version === undefined) {
+			if (node.type === 'host' && !node.version) {
 			    node.version = data.versions[node.name];
 			}
 
-- 
2.20.1




More information about the pve-devel mailing list