]> git.proxmox.com Git - pve-cluster.git/commitdiff
corosync config: support 'linknumber' property
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Mon, 27 May 2019 16:08:47 +0000 (18:08 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Wed, 26 Jun 2019 16:52:27 +0000 (18:52 +0200)
Corosync 3 has moved its rings a layer up, i.e., abstracted away from
the network layer below. That what early were called rings are now
links, knet can have up to 8 all others 1, for now.

Let our parser understand this change in the totem section of the
config, to help on upgrade to corosync 3

While we are at it, try to write out the two map operations used in a
bit more readable way.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
(partially cherry picked from commit
  018bbcab945134d9d2d979abe68726deddd4fd0d)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
data/PVE/Corosync.pm

index e46a1192475c248463d219ee44b2adae00d70068..2fb392a8a03fa8f9e0b4b3c8188a7afeda51003e 100644 (file)
@@ -73,8 +73,17 @@ sub parse_conf {
 
     # make working with the config way easier
     my ($totem, $nodelist) = $conf->{main}->@{"totem", "nodelist"};
-    $nodelist->{node} = { map { $_->{name} // $_->{ring0_addr} => $_ } @{$nodelist->{node}} };
-    $totem->{interface} = { map { $_->{ringnumber} => $_ } @{$totem->{interface}} };
+
+    $nodelist->{node} = {
+       map {
+           $_->{name} // $_->{ring0_addr} => $_
+       } @{$nodelist->{node}}
+    };
+    $totem->{interface} = {
+       map {
+           $_->{linknumber} // $_->{ringnumber} => $_
+       } @{$totem->{interface}}
+    };
 
     $conf->{digest} = $digest;