From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id D82019F016 for ; Wed, 7 Jun 2023 16:45:02 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id B89CC1B56D for ; Wed, 7 Jun 2023 16:45:02 +0200 (CEST) Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com [94.136.29.106]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS for ; Wed, 7 Jun 2023 16:45:02 +0200 (CEST) Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id B91A341ED6 for ; Wed, 7 Jun 2023 16:45:01 +0200 (CEST) Date: Wed, 07 Jun 2023 16:44:54 +0200 From: Fabian =?iso-8859-1?q?Gr=FCnbichler?= To: Proxmox VE development discussion References: <20230607120357.4177891-1-aderumier@odiso.com> <20230607120357.4177891-7-aderumier@odiso.com> In-Reply-To: <20230607120357.4177891-7-aderumier@odiso.com> MIME-Version: 1.0 User-Agent: astroid/0.16.0 (https://github.com/astroidmail/astroid) Message-Id: <1686148973.xr3oxvnsbs.astroid@yuna.none> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-SPAM-LEVEL: Spam detection results: 0 AWL 0.072 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record T_SCC_BODY_TEXT_LINE -0.01 - Subject: Re: [pve-devel] [PATCH v3 pve-manager 2/4] api2: cluster: ressources: add "localnetwork" zone X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Jun 2023 14:45:02 -0000 I had the following fixup for this locally: ``` diff --git a/PVE/API2/Cluster.pm b/PVE/API2/Cluster.pm index a7224d7f3..07e5261f2 100644 --- a/PVE/API2/Cluster.pm +++ b/PVE/API2/Cluster.pm @@ -474,23 +474,22 @@ __PACKAGE__->register_method({ } } =20 - #add default "localnetwork" zone - if ($rpcenv->check($authuser, "/sdn/zones/localnetwork", [ 'SDN.Audit' ],= 1)) { - foreach my $node (@$nodelist) { - my $local_sdn =3D { - id =3D> "sdn/$node/localnetwork", - sdn =3D> 'localnetwork', - node =3D> $node, - type =3D> 'sdn', - status =3D> 'ok', - }; - push @$res, $local_sdn; + if (!$param->{type} || $param->{type} eq 'sdn') { + #add default "localnetwork" zone + if ($rpcenv->check($authuser, "/sdn/zones/localnetwork", [ 'SDN.Audit= ' ], 1)) { + foreach my $node (@$nodelist) { + my $local_sdn =3D { + id =3D> "sdn/$node/localnetwork", + sdn =3D> 'localnetwork', + node =3D> $node, + type =3D> 'sdn', + status =3D> 'ok', + }; + push @$res, $local_sdn; + } } - } - - if ($have_sdn) { - if (!$param->{type} || $param->{type} eq 'sdn') { =20 + if ($have_sdn) { my $nodes =3D PVE::Cluster::get_node_kv("sdn"); =20 for my $node (sort keys %{$nodes}) { ``` but then when testing I realized that this makes a 'localnetwork' entry appear in the tree in the GUI, but it's not possible to open it? or maybe it needs the GUI patches that I haven't had the time to look at yet ;) but maybe something to take into account in the next version, didn't apply this one for now.. On June 7, 2023 2:03 pm, Alexandre Derumier wrote: > Signed-off-by: Alexandre Derumier > --- > PVE/API2/Cluster.pm | 14 ++++++++++++++ > 1 file changed, 14 insertions(+) >=20 > diff --git a/PVE/API2/Cluster.pm b/PVE/API2/Cluster.pm > index 2e942368..a7224d7f 100644 > --- a/PVE/API2/Cluster.pm > +++ b/PVE/API2/Cluster.pm > @@ -474,6 +474,20 @@ __PACKAGE__->register_method({ > } > } > =20 > + #add default "localnetwork" zone > + if ($rpcenv->check($authuser, "/sdn/zones/localnetwork", [ 'SDN.Audit' = ], 1)) { > + foreach my $node (@$nodelist) { > + my $local_sdn =3D { > + id =3D> "sdn/$node/localnetwork", > + sdn =3D> 'localnetwork', > + node =3D> $node, > + type =3D> 'sdn', > + status =3D> 'ok', > + }; > + push @$res, $local_sdn; > + } > + } > + > if ($have_sdn) { > if (!$param->{type} || $param->{type} eq 'sdn') { > =20 > --=20 > 2.30.2 >=20 >=20 > _______________________________________________ > pve-devel mailing list > pve-devel@lists.proxmox.com > https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel >=20 >=20 >=20