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>
# 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;