all lists on lists.proxmox.com
 help / color / mirror / Atom feed
From: Tiomet Pelston via pve-devel <pve-devel@lists.proxmox.com>
To: pve-devel@lists.proxmox.com
Cc: Tiomet Pelston <tiometpelston@gmail.com>
Subject: [pve-devel] [PATCH common 1/1] fix #5623: ovs other_config set to 0 not saved in network config
Date: Wed, 23 Oct 2024 18:48:49 +0200	[thread overview]
Message-ID: <mailman.513.1729702144.332.pve-devel@lists.proxmox.com> (raw)
In-Reply-To: <20241023164849.3027-1-tiometpelston@gmail.com>

[-- Attachment #1: Type: message/rfc822, Size: 5655 bytes --]

From: Tiomet Pelston <tiometpelston@gmail.com>
To: pve-devel@lists.proxmox.com
Subject: [PATCH common 1/1] fix #5623: ovs other_config set to 0 not saved in network config
Date: Wed, 23 Oct 2024 18:48:49 +0200
Message-ID: <20241023164849.3027-2-tiometpelston@gmail.com>

When configuring an OVS network device via web interface,
any OVS option set to value=0 is ignored upon saving. This happens
because value=0 is evaluated as false in $parse_ovs_option.

Signed-off-by: Tiomet Pelston <tiometpelston@gmail.com>
---
 src/PVE/INotify.pm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/PVE/INotify.pm b/src/PVE/INotify.pm
index 8a4a810..1b3babd 100644
--- a/src/PVE/INotify.pm
+++ b/src/PVE/INotify.pm
@@ -748,7 +748,7 @@ my $parse_ovs_option = sub {
     my $opts = {};
     foreach my $kv (split (/\s+/, $data || '')) {
 	my ($k, $v) = split('=', $kv, 2);
-	$opts->{$k} = $v if $k && $v;
+	$opts->{$k} = $v if $k && defined($v);
     }
     return $opts;
 };
-- 
2.43.0



[-- Attachment #2: Type: text/plain, Size: 160 bytes --]

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

       reply	other threads:[~2024-10-23 16:48 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20241023164849.3027-1-tiometpelston@gmail.com>
2024-10-23 16:48 ` Tiomet Pelston via pve-devel [this message]
2024-10-29 15:29   ` Aaron Lauterer
2024-10-30  8:53     ` Thomas Lamprecht

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=mailman.513.1729702144.332.pve-devel@lists.proxmox.com \
    --to=pve-devel@lists.proxmox.com \
    --cc=tiometpelston@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal