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 8A8837773F for ; Wed, 28 Apr 2021 10:29:24 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 7B9EF27E05 for ; Wed, 28 Apr 2021 10:29:24 +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 id 67F5827DF9 for ; Wed, 28 Apr 2021 10:29:23 +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 20D894294C for ; Wed, 28 Apr 2021 10:22:54 +0200 (CEST) From: Fabian Ebner To: pmg-devel@lists.proxmox.com Date: Wed, 28 Apr 2021 10:22:50 +0200 Message-Id: <20210428082250.30795-1-f.ebner@proxmox.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 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 Subject: [pmg-devel] [PATCH pmg-api] api: upload costum certificate: actually return info X-BeenThere: pmg-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox Mail Gateway development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Apr 2021 08:29:24 -0000 Signed-off-by: Fabian Ebner --- src/PMG/API2/Certificates.pm | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/PMG/API2/Certificates.pm b/src/PMG/API2/Certificates.pm index c08deb6..1db4a90 100644 --- a/src/PMG/API2/Certificates.pm +++ b/src/PMG/API2/Certificates.pm @@ -57,11 +57,13 @@ my sub update_cert : prototype($$$$$) { my ($type, $cert_path, $certificate, $force, $restart) = @_; my $code = sub { print "Setting custom certificate file $cert_path\n"; - PMG::CertHelpers::set_cert_file($certificate, $cert_path, $force); + my $info = PMG::CertHelpers::set_cert_file($certificate, $cert_path, $force); restart_after_cert_update($type) if $restart; + + return $info; }; - PMG::CertHelpers::cert_lock(10, $code); + return PMG::CertHelpers::cert_lock(10, $code); }; my sub set_smtp : prototype($$) { @@ -250,7 +252,7 @@ __PACKAGE__->register_method ({ my $info; PMG::CertHelpers::cert_lock(10, sub { - update_cert($type, $cert_path, $certs, $param->{force}, $param->{restart}); + $info = update_cert($type, $cert_path, $certs, $param->{force}, $param->{restart}); }); if ($type eq 'smtp') { -- 2.20.1