]> git.proxmox.com Git - pmg-api.git/commitdiff
api: upload costum certificate: actually return info
authorFabian Ebner <f.ebner@proxmox.com>
Wed, 28 Apr 2021 08:22:50 +0000 (10:22 +0200)
committerStoiko Ivanov <s.ivanov@proxmox.com>
Wed, 28 Apr 2021 08:51:15 +0000 (10:51 +0200)
Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
src/PMG/API2/Certificates.pm

index c08deb6518ef8d191d984bd8f9d8b77f593663ee..1db4a90ac26b00ae9f6b4e9ae19436e65b8a21a0 100644 (file)
@@ -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') {