]> git.proxmox.com Git - pve-cluster.git/commitdiff
pvecm: check early if the deletion cannot work
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Thu, 23 Nov 2017 11:12:04 +0000 (12:12 +0100)
committerWolfgang Bumiller <w.bumiller@proxmox.com>
Mon, 27 Nov 2017 08:10:54 +0000 (09:10 +0100)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
data/PVE/CLI/pvecm.pm

index 9437368f0de3aa7e4b0ed7d8062292b176ed8b54..ba72bfe085fd4f2624b6f7496d791cf6f3957380 100755 (executable)
@@ -412,6 +412,9 @@ __PACKAGE__->register_method ({
     code => sub {
        my ($param) = @_;
 
+       my $local_node = PVE::INotify::nodename();
+       die "Cannot delete myself from cluster!\n" if $param->{node} eq $local_node;
+
        PVE::Cluster::check_cfs_quorum();
 
        my $code = sub {
@@ -437,9 +440,6 @@ __PACKAGE__->register_method ({
            die "Node/IP: $param->{node} is not a known host of the cluster.\n"
                if !defined($node);
 
-           my $our_nodename = PVE::INotify::nodename();
-           die "Cannot delete myself from cluster!\n" if $node eq $our_nodename;
-
            delete $nodelist->{$node};
 
            PVE::Corosync::update_nodelist($conf, $nodelist);