[pve-devel] [PATCH manager 2/4] parse node config: remove "\s*" from comment regex

Stefan Sterz s.sterz at proxmox.com
Thu Feb 24 15:21:49 CET 2022


To be consistent with PBS's implementation of multi-line comments
remove "\s*" here too. Since the regex isn't lazy .* matches
everything \s* would anyway. (Note that new lines occurs after "$").

Signed-off-by: Stefan Sterz <s.sterz at proxmox.com>
---
 PVE/NodeConfig.pm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/PVE/NodeConfig.pm b/PVE/NodeConfig.pm
index df44410f..4c2fc570 100644
--- a/PVE/NodeConfig.pm
+++ b/PVE/NodeConfig.pm
@@ -205,7 +205,7 @@ sub parse_node_config {
 
     my @lines = split(/\n/, $content);
     foreach my $line (@lines) {
-	if ($line =~ /^\#(.*)\s*$/ || $line =~ /^description:\s*(.*\S)\s*$/) {
+	if ($line =~ /^\#(.*)$/ || $line =~ /^description:\s*(.*\S)\s*$/) {
 	    $descr .= PVE::Tools::decode_text($1) . "\n";
 	    next;
 	}
-- 
2.30.2






More information about the pve-devel mailing list