* Renamed bond_active_slave to bond_active_interface.

Signed-off-by: Digimer <digimer@alteeve.ca>
main
Digimer 5 years ago
parent 12b0cc28f0
commit 54de5466cf
  1. 20
      Anvil/Tools/Database.pm
  2. 10
      Anvil/Tools/Network.pm
  3. 2
      Anvil/Tools/Striker.pm
  4. 6
      Anvil/Tools/System.pm
  5. 8
      share/anvil.sql
  6. 30
      tools/anvil-update-states

@ -2374,7 +2374,7 @@ This is the primary interface name in the bond.
This is the primary interface reselect policy.
=head2 bond_active_slave (optional)
=head2 bond_active_interface (optional)
This is the interface currently being used by the bond.
@ -2411,7 +2411,7 @@ sub insert_or_update_bonds
my $bond_mtu = defined $parameter->{bond_mtu} ? $parameter->{bond_mtu} : "";
my $bond_primary_interface = defined $parameter->{bond_primary_interface} ? $parameter->{bond_primary_interface} : "";
my $bond_primary_reselect = defined $parameter->{bond_primary_reselect} ? $parameter->{bond_primary_reselect} : "";
my $bond_active_slave = defined $parameter->{bond_active_slave} ? $parameter->{bond_active_slave} : "";
my $bond_active_interface = defined $parameter->{bond_active_interface} ? $parameter->{bond_active_interface} : "";
my $bond_mii_polling_interval = defined $parameter->{bond_mii_polling_interval} ? $parameter->{bond_mii_polling_interval} : "";
my $bond_up_delay = defined $parameter->{bond_up_delay} ? $parameter->{bond_up_delay} : "";
my $bond_down_delay = defined $parameter->{bond_down_delay} ? $parameter->{bond_down_delay} : "";
@ -2428,7 +2428,7 @@ sub insert_or_update_bonds
bond_mtu => $bond_mtu,
bond_primary_interface => $bond_primary_interface,
bond_primary_reselect => $bond_primary_reselect,
bond_active_slave => $bond_active_slave,
bond_active_interface => $bond_active_interface,
bond_mii_polling_interval => $bond_mii_polling_interval,
bond_up_delay => $bond_up_delay,
bond_down_delay => $bond_down_delay,
@ -2518,7 +2518,7 @@ INSERT INTO
bond_mtu,
bond_primary_interface,
bond_primary_reselect,
bond_active_slave,
bond_active_interface,
bond_mii_polling_interval,
bond_up_delay,
bond_down_delay,
@ -2533,7 +2533,7 @@ INSERT INTO
".$anvil->Database->quote($bond_mtu).",
".$anvil->Database->quote($bond_primary_interface).",
".$anvil->Database->quote($bond_primary_reselect).",
".$anvil->Database->quote($bond_active_slave).",
".$anvil->Database->quote($bond_active_interface).",
".$anvil->Database->quote($bond_mii_polling_interval).",
".$anvil->Database->quote($bond_up_delay).",
".$anvil->Database->quote($bond_down_delay).",
@ -2556,7 +2556,7 @@ SELECT
bond_mtu,
bond_primary_interface,
bond_primary_reselect,
bond_active_slave,
bond_active_interface,
bond_mii_polling_interval,
bond_up_delay,
bond_down_delay,
@ -2589,7 +2589,7 @@ WHERE
my $old_bond_mtu = $row->[3];
my $old_bond_primary_interface = $row->[4];
my $old_bond_primary_reselect = $row->[5];
my $old_bond_active_slave = $row->[6];
my $old_bond_active_interface = $row->[6];
my $old_bond_mii_polling_interval = $row->[7];
my $old_bond_up_delay = $row->[8];
my $old_bond_down_delay = $row->[9];
@ -2602,7 +2602,7 @@ WHERE
old_bond_mtu => $old_bond_mtu,
old_bond_primary_interface => $old_bond_primary_interface,
old_bond_primary_reselect => $old_bond_primary_reselect,
old_bond_active_slave => $old_bond_active_slave,
old_bond_active_interface => $old_bond_active_interface,
old_bond_mii_polling_interval => $old_bond_mii_polling_interval,
old_bond_up_delay => $old_bond_up_delay,
old_bond_down_delay => $old_bond_down_delay,
@ -2617,7 +2617,7 @@ WHERE
($old_bond_mtu ne $bond_mtu) or
($old_bond_primary_interface ne $bond_primary_interface) or
($old_bond_primary_reselect ne $bond_primary_reselect) or
($old_bond_active_slave ne $bond_active_slave) or
($old_bond_active_interface ne $bond_active_interface) or
($old_bond_mii_polling_interval ne $bond_mii_polling_interval) or
($old_bond_up_delay ne $bond_up_delay) or
($old_bond_down_delay ne $bond_down_delay) or
@ -2635,7 +2635,7 @@ SET
bond_mtu = ".$anvil->Database->quote($bond_mtu).",
bond_primary_interface = ".$anvil->Database->quote($bond_primary_interface).",
bond_primary_reselect = ".$anvil->Database->quote($bond_primary_reselect).",
bond_active_slave = ".$anvil->Database->quote($bond_active_slave).",
bond_active_interface = ".$anvil->Database->quote($bond_active_interface).",
bond_mii_polling_interval = ".$anvil->Database->quote($bond_mii_polling_interval).",
bond_up_delay = ".$anvil->Database->quote($bond_up_delay).",
bond_down_delay = ".$anvil->Database->quote($bond_down_delay).",

@ -795,7 +795,7 @@ SELECT
bond_mtu,
bond_primary_interface,
bond_primary_reselect,
bond_active_slave,
bond_active_interface,
bond_mii_polling_interval,
bond_up_delay,
bond_down_delay,
@ -821,7 +821,7 @@ AND
my $bond_mtu = defined $row->[3] ? $row->[3] : "";
my $bond_primary_interface = defined $row->[4] ? $row->[4] : "";
my $bond_primary_reselect = defined $row->[5] ? $row->[5] : "";
my $bond_active_slave = defined $row->[6] ? $row->[6] : "";
my $bond_active_interface = defined $row->[6] ? $row->[6] : "";
my $bond_mii_polling_interval = defined $row->[7] ? $row->[7] : "";
my $bond_up_delay = defined $row->[8] ? $row->[8] : "";
my $bond_down_delay = defined $row->[9] ? $row->[9] : "";
@ -834,7 +834,7 @@ AND
bond_mtu => $bond_mtu,
bond_primary_interface => $bond_primary_interface,
bond_primary_reselect => $bond_primary_reselect,
bond_active_slave => $bond_active_slave,
bond_active_interface => $bond_active_interface,
bond_mii_polling_interval => $bond_mii_polling_interval,
bond_up_delay => $bond_up_delay,
bond_down_delay => $bond_down_delay,
@ -854,7 +854,7 @@ AND
$anvil->data->{network}{$host}{interface}{$bond_name}{mtu} = $bond_mtu;
$anvil->data->{network}{$host}{interface}{$bond_name}{primary_interface} = $bond_primary_interface;
$anvil->data->{network}{$host}{interface}{$bond_name}{primary_reselect} = $bond_primary_reselect;
$anvil->data->{network}{$host}{interface}{$bond_name}{active_slave} = $bond_active_slave;
$anvil->data->{network}{$host}{interface}{$bond_name}{active_interface} = $bond_active_interface;
$anvil->data->{network}{$host}{interface}{$bond_name}{mii_polling_interval} = $bond_mii_polling_interval;
$anvil->data->{network}{$host}{interface}{$bond_name}{up_delay} = $bond_up_delay;
$anvil->data->{network}{$host}{interface}{$bond_name}{down_delay} = $bond_down_delay;
@ -868,7 +868,7 @@ AND
"network::${host}::interface::${bond_name}::mtu" => $anvil->data->{network}{$host}{interface}{$bond_name}{mtu},
"network::${host}::interface::${bond_name}::primary_interface" => $anvil->data->{network}{$host}{interface}{$bond_name}{primary_interface},
"network::${host}::interface::${bond_name}::primary_reselect" => $anvil->data->{network}{$host}{interface}{$bond_name}{primary_reselect},
"network::${host}::interface::${bond_name}::active_slave" => $anvil->data->{network}{$host}{interface}{$bond_name}{active_slave},
"network::${host}::interface::${bond_name}::active_interface" => $anvil->data->{network}{$host}{interface}{$bond_name}{active_interface},
"network::${host}::interface::${bond_name}::mii_polling_interval" => $anvil->data->{network}{$host}{interface}{$bond_name}{mii_polling_interval},
"network::${host}::interface::${bond_name}::up_delay" => $anvil->data->{network}{$host}{interface}{$bond_name}{up_delay},
"network::${host}::interface::${bond_name}::down_delay" => $anvil->data->{network}{$host}{interface}{$bond_name}{down_delay},

@ -430,7 +430,7 @@ sub parse_all_status_json
if ($interface_type eq "bond")
{
$anvil->data->{json}{all_status}{hosts}{$host_name}{network_interface}{$interface_type}{$interface_name}{mode} = $interface_hash->{mode};
$anvil->data->{json}{all_status}{hosts}{$host_name}{network_interface}{$interface_type}{$interface_name}{active_interface} = $interface_hash->{active_slave};
$anvil->data->{json}{all_status}{hosts}{$host_name}{network_interface}{$interface_type}{$interface_name}{active_interface} = $interface_hash->{active_interface};
$anvil->data->{json}{all_status}{hosts}{$host_name}{network_interface}{$interface_type}{$interface_name}{primary_interface} = $interface_hash->{primary_interface};
$anvil->data->{json}{all_status}{hosts}{$host_name}{network_interface}{$interface_type}{$interface_name}{primary_reselect} = $interface_hash->{primary_reselect};
$anvil->data->{json}{all_status}{hosts}{$host_name}{network_interface}{$interface_type}{$interface_name}{up_delay} = $interface_hash->{up_delay};

@ -863,7 +863,7 @@ sub generate_state_json
my $mode = $anvil->data->{network}{$host}{interface}{$interface}{mode};
my $primary_interface = $anvil->data->{network}{$host}{interface}{$interface}{primary_interface};
my $primary_reselect = $anvil->data->{network}{$host}{interface}{$interface}{primary_reselect};
my $active_slave = $anvil->data->{network}{$host}{interface}{$interface}{active_slave};
my $active_interface = $anvil->data->{network}{$host}{interface}{$interface}{active_interface};
my $mii_polling_interval = $anvil->Convert->add_commas({number => $anvil->data->{network}{$host}{interface}{$interface}{mii_polling_interval}});
my $say_up_delay = $anvil->Convert->add_commas({number => $anvil->data->{network}{$host}{interface}{$interface}{up_delay}});
my $up_delay = $anvil->data->{network}{$host}{interface}{$interface}{up_delay};
@ -929,7 +929,7 @@ sub generate_state_json
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $debug, list => {
say_mode => $say_mode,
mode => $mode,
active_interface => $active_slave,
active_interface => $active_interface,
primary_interface => $primary_interface,
say_primary_reselect => $say_primary_reselect,
primary_reselect => $primary_reselect,
@ -949,7 +949,7 @@ sub generate_state_json
}
$iface_hash->{say_mode} = $say_mode;
$iface_hash->{mode} = $mode;
$iface_hash->{active_interface} = $active_slave;
$iface_hash->{active_interface} = $active_interface;
$iface_hash->{primary_interface} = $primary_interface;
$iface_hash->{primary_reselect} = $primary_reselect;
$iface_hash->{say_up_delay} = $say_up_delay;

@ -898,7 +898,7 @@ CREATE TABLE bonds (
bond_mtu bigint not null,
bond_primary_interface text not null,
bond_primary_reselect text not null,
bond_active_slave text not null,
bond_active_interface text not null,
bond_mii_polling_interval bigint not null,
bond_up_delay bigint not null,
bond_down_delay bigint not null,
@ -919,7 +919,7 @@ CREATE TABLE history.bonds (
bond_mtu bigint,
bond_primary_interface text,
bond_primary_reselect text,
bond_active_slave text,
bond_active_interface text,
bond_mii_polling_interval bigint,
bond_up_delay bigint,
bond_down_delay bigint,
@ -943,7 +943,7 @@ BEGIN
bond_mtu,
bond_primary_interface,
bond_primary_reselect,
bond_active_slave,
bond_active_interface,
bond_mii_polling_interval,
bond_up_delay,
bond_down_delay,
@ -958,7 +958,7 @@ BEGIN
history_bonds.bond_mtu,
history_bonds.bond_primary_interface,
history_bonds.bond_primary_reselect,
history_bonds.bond_active_slave,
history_bonds.bond_active_interface,
history_bonds.bond_mii_polling_interval,
history_bonds.bond_up_delay,
history_bonds.bond_down_delay,

@ -112,7 +112,7 @@ sub update_network
my $bond_mode = "";
my $primary_interface = "";
my $primary_reselect = "";
my $active_slave = "";
my $active_interface = "";
my $mii_polling_interval = "";
my $up_delay = "";
my $down_delay = "";
@ -177,7 +177,7 @@ sub update_network
$bond_mode = $anvil->Storage->read_file({file => "/sys/devices/virtual/net/".$interface."/bonding/mode"});
$primary_interface = $anvil->Storage->read_file({file => "/sys/devices/virtual/net/".$interface."/bonding/primary"});
$primary_reselect = $anvil->Storage->read_file({file => "/sys/devices/virtual/net/".$interface."/bonding/primary_reselect"});
$active_slave = $anvil->Storage->read_file({file => "/sys/devices/virtual/net/".$interface."/bonding/active_slave"});
$active_interface = $anvil->Storage->read_file({file => "/sys/devices/virtual/net/".$interface."/bonding/active_slave"});
$mii_polling_interval = $anvil->Storage->read_file({file => "/sys/devices/virtual/net/".$interface."/bonding/miimon"});
$up_delay = $anvil->Storage->read_file({file => "/sys/devices/virtual/net/".$interface."/bonding/updelay"});
$down_delay = $anvil->Storage->read_file({file => "/sys/devices/virtual/net/".$interface."/bonding/downdelay"});
@ -186,12 +186,12 @@ sub update_network
$primary_interface =~ s/\n$//;
$primary_reselect =~ s/\s.*//;
$primary_reselect =~ s/\n$//;
$active_slave =~ s/\n$//;
$active_interface =~ s/\n$//;
$mii_polling_interval =~ s/\n$//;
$up_delay =~ s/\n$//;
$down_delay =~ s/\n$//;
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 3, list => {
active_slave => $active_slave,
active_interface => $active_interface,
bond_mode => $bond_mode,
mii_polling_interval => $mii_polling_interval,
primary_reselect => $primary_reselect,
@ -238,7 +238,7 @@ sub update_network
}
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 3, list => {
active_slave => $active_slave,
active_interface => $active_interface,
bond_master => $bond_master,
bond_mode => $bond_mode,
bridge_id => $bridge_id,
@ -300,7 +300,7 @@ sub update_network
}
# Store new information we found.
$anvil->data->{network}{'local'}{interface}{$interface}{active_slave} = $active_slave;
$anvil->data->{network}{'local'}{interface}{$interface}{active_interface} = $active_interface;
$anvil->data->{network}{'local'}{interface}{$interface}{bond_mode} = $bond_mode;
$anvil->data->{network}{'local'}{interface}{$interface}{bond_master} = $bond_master;
$anvil->data->{network}{'local'}{interface}{$interface}{bridge_id} = $bridge_id;
@ -317,11 +317,11 @@ sub update_network
$anvil->data->{network}{'local'}{interface}{$interface}{primary_reselect} = $primary_reselect;
$anvil->data->{network}{'local'}{interface}{$interface}{primary_interface} = $primary_interface;
$anvil->data->{network}{'local'}{interface}{$interface}{speed} = $speed;
$anvil->data->{network}{'local'}{interface}{$interface}{subnet_mask} = $subnet_mask;
$anvil->data->{network}{'local'}{interface}{$interface}{subnet_mask} = $subnet_mask;
$anvil->data->{network}{'local'}{interface}{$interface}{type} = $type;
$anvil->data->{network}{'local'}{interface}{$interface}{up_delay} = $up_delay;
$anvil->data->{network}{'local'}{interface}{$interface}{up_delay} $up_delay;
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 3, list => {
"network::local::interface::${interface}::active_slave" => $anvil->data->{network}{'local'}{interface}{$interface}{active_slave},
"network::local::interface::${interface}::active_interface" => $anvil->data->{network}{'local'}{interface}{$interface}{active_interface},
"network::local::interface::${interface}::bond_mode" => $anvil->data->{network}{'local'}{interface}{$interface}{bond_mode},
"network::local::interface::${interface}::bond_master" => $anvil->data->{network}{'local'}{interface}{$interface}{bond_master},
"network::local::interface::${interface}::bridge_id" => $anvil->data->{network}{'local'}{interface}{$interface}{bridge_id},
@ -363,7 +363,7 @@ sub update_network
}});
next if $processing ne $anvil->data->{network}{'local'}{interface}{$interface}{type};
my $active_slave = $anvil->data->{network}{'local'}{interface}{$interface}{active_slave};
my $active_interface = $anvil->data->{network}{'local'}{interface}{$interface}{active_interface};
my $bond_mode = $anvil->data->{network}{'local'}{interface}{$interface}{bond_mode};
my $bond_master = $anvil->data->{network}{'local'}{interface}{$interface}{bond_master};
my $bridge_id = $anvil->data->{network}{'local'}{interface}{$interface}{bridge_id};
@ -386,7 +386,7 @@ sub update_network
my $gateway = $anvil->data->{network}{'local'}{interface}{$interface}{gateway};
my $dns = $anvil->data->{network}{'local'}{interface}{$interface}{dns};
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 3, list => {
active_slave => $active_slave,
active_interface => $active_interface,
bond_mode => $bond_mode,
bond_master => $bond_master,
default_gateway => $default_gateway,
@ -423,7 +423,7 @@ sub update_network
bond_mac_address => $mac_address,
bond_primary_interface => $primary_interface,
bond_primary_reselect => $primary_reselect,
bond_active_slave => $active_slave,
bond_active_interface => $active_interface,
bond_mii_polling_interval => $mii_polling_interval,
bond_up_delay => $up_delay,
bond_down_delay => $down_delay,
@ -542,7 +542,7 @@ SELECT
bond_mtu,
bond_primary_interface,
bond_primary_reselect,
bond_active_slave,
bond_active_interface,
bond_mii_polling_interval,
bond_up_delay,
bond_down_delay,
@ -572,7 +572,7 @@ AND
bond_mtu => $row->[3],
bond_primary_interface => $row->[4],
bond_primary_reselect => $row->[5],
bond_active_slave => $row->[6],
bond_active_interface => $row->[6],
bond_mii_polling_interval => $row->[7],
bond_up_delay => $row->[8],
bond_down_delay => $row->[9],
@ -585,7 +585,7 @@ AND
"bonds::${bond_uuid}::bond_mtu" => $anvil->data->{bonds}{$bond_uuid}{bond_mtu},
"bonds::${bond_uuid}::bond_primary_interface" => $anvil->data->{bonds}{$bond_uuid}{bond_primary_interface},
"bonds::${bond_uuid}::bond_primary_reselect" => $anvil->data->{bonds}{$bond_uuid}{bond_primary_reselect},
"bonds::${bond_uuid}::bond_active_slave" => $anvil->data->{bonds}{$bond_uuid}{bond_active_slave},
"bonds::${bond_uuid}::bond_active_interface" => $anvil->data->{bonds}{$bond_uuid}{bond_active_interface},
"bonds::${bond_uuid}::bond_mii_polling_interval" => $anvil->data->{bonds}{$bond_uuid}{bond_mii_polling_interval},
"bonds::${bond_uuid}::bond_up_delay" => $anvil->data->{bonds}{$bond_uuid}{bond_up_delay},
"bonds::${bond_uuid}::bond_down_delay" => $anvil->data->{bonds}{$bond_uuid}{bond_down_delay},

Loading…
Cancel
Save