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.csa...@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


_______________________________________________
pve-devel mailing list
pve-devel@pve.proxmox.com
https://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel

Reply via email to