[pve-devel] [PATCH cluster] allow also deleting a node by name when ringX_addr is a IP

Thomas Lamprecht t.lamprecht at proxmox.com
Tue Sep 20 10:17:44 CEST 2016


This is an additional (convenience) fix for the delnode param.
As we always have the node name in our config - either the 'name'
(preferred) or the 'ring0_addr' property of a node entry in the
corosync.conf holds it - allow also deleting by it if the ringX_addr
is set to an IP, else this may be confusing as the user uses
normally the node name only to do things.

Signed-off-by: Thomas Lamprecht <t.lamprecht at proxmox.com>
---

This is a follow up patch for the recently pushed commits
7aed82482c7a0eef13582f61ed6bfd69cb7ff33c
d09373b46d6ffdc260e842dd3946e732ec0233ee
which patch set I overlooked on the mailing list

 data/PVE/CLI/pvecm.pm | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/data/PVE/CLI/pvecm.pm b/data/PVE/CLI/pvecm.pm
index b26a1ec..b72fb00 100755
--- a/data/PVE/CLI/pvecm.pm
+++ b/data/PVE/CLI/pvecm.pm
@@ -414,9 +414,11 @@ __PACKAGE__->register_method ({
 
 	foreach my $tmp_node (keys %$nodelist) {
 	    my $d = $nodelist->{$tmp_node};
+	    my $name = $d->{name};
 	    my $ring0_addr = $d->{ring0_addr};
 	    my $ring1_addr = $d->{ring1_addr};
 	    if (($tmp_node eq $param->{node}) ||
+		(defined($name) && ($name eq $param->{node})) ||
 		(defined($ring0_addr) && ($ring0_addr eq $param->{node})) ||
 		(defined($ring1_addr) && ($ring1_addr eq $param->{node}))) {
 		$node = $tmp_node;
-- 
2.1.4





More information about the pve-devel mailing list