]> git.proxmox.com Git - pmg-api.git/commitdiff
pmgcm: do not error out if not a cluster
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Tue, 16 Mar 2021 18:03:32 +0000 (19:03 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Tue, 16 Mar 2021 18:13:31 +0000 (19:13 +0100)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
src/PMG/CLI/pmgcm.pm

index 4d9f05731b00a96ae573f4d52583cbf3d558f3cc..c5ce912c18541cda01527658c0d3166ff682239f 100644 (file)
@@ -320,8 +320,10 @@ __PACKAGE__->register_method({
        my ($param) = @_;
 
        my $cinfo = PMG::ClusterConfig->new();
-
-       die "no cluster defined\n" if !scalar(keys %{$cinfo->{ids}});
+       if (!scalar(keys %{$cinfo->{ids}})) {
+           warn "no cluster defined, nothing to do...\n";
+           return undef;
+       }
 
        PMG::Cluster::trigger_update_fingerprints($cinfo);
     }});