[pve-devel] [PATCH v1 pve-manager 5/8] utils: align regex of parse_ceph_version with Perl equivalent

Max Carrara m.carrara at proxmox.com
Tue Apr 30 17:28:54 CEST 2024


Signed-off-by: Max Carrara <m.carrara at proxmox.com>
---
"Unfortunately" JS doesn't support comments in its regexes akin to
Perl's 'x' flag, but oh well ...

 www/manager6/Utils.js | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/www/manager6/Utils.js b/www/manager6/Utils.js
index f5608944..74e46694 100644
--- a/www/manager6/Utils.js
+++ b/www/manager6/Utils.js
@@ -118,7 +118,8 @@ Ext.define('PVE.Utils', {
 	}
 
 	if (service.ceph_version) {
-	    var match = service.ceph_version.match(/version (\d+(\.\d+)*)/);
+	    // See PVE/Ceph/Tools.pm - get_local_version
+	    const match = service.ceph_version.match(/^ceph.*\sv?(\d+(?:\.\d+)+)/);
 	    if (match) {
 		return match[1];
 	    }
-- 
2.39.2





More information about the pve-devel mailing list