summaryrefslogtreecommitdiff
path: root/src/PVE/API2/Network/SDN.pm
diff options
context:
space:
mode:
authorAlexandre Derumier <aderumier@odiso.com>2023-04-20 23:36:22 +0200
committerThomas Lamprecht <t.lamprecht@proxmox.com>2023-06-06 10:23:57 +0200
commit0626bbf7b3c4d3c92f4af868f2924a46354effb7 (patch)
tree6ebf5bc2d4df98ff7b45c667cc7fc1b25be26106 /src/PVE/API2/Network/SDN.pm
parentde4e2b9cf404af8423e08bc026e76d92e308109c (diff)
network reload: fix UPID parsing
When warning or error from ifreload are logged they are received in 1 line in result of pvesh. So, the UPID might not always start at the beginning, which was assumed by the old code, failing parsing it, throwing a warning like: > Use of uninitialized value $upid in pattern match (m//) at /usr/share/perl5/PVE/Tools.pm line 1106. > Use of uninitialized value $upid in concatenation (.) or string at /usr/share/perl5/PVE/Tools.pm line 1120. Drop the start anchor of the regex. Signed-off-by: Alexandre Derumier <aderumier@odiso.com> Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Diffstat (limited to 'src/PVE/API2/Network/SDN.pm')
-rw-r--r--src/PVE/API2/Network/SDN.pm3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/PVE/API2/Network/SDN.pm b/src/PVE/API2/Network/SDN.pm
index f129d60..33ecfb7 100644
--- a/src/PVE/API2/Network/SDN.pm
+++ b/src/PVE/API2/Network/SDN.pm
@@ -86,9 +86,10 @@ my $create_reload_network_worker = sub {
# FIXME: how to proxy to final node ?
my $upid;
+ print "$nodename: reloading network config\n";
run_command(['pvesh', 'set', "/nodes/$nodename/network"], outfunc => sub {
my $line = shift;
- if ($line =~ /^["']?(UPID:[^\s"']+)["']?$/) {
+ if ($line =~ /["']?(UPID:[^\s"']+)["']?$/) {
$upid = $1;
}
});