* Changed a bunch more variables to standardize on 'mac_address' instead of 'mac'.

* Added ' --best --allowerasing' to the dnf call in tools/anvil-update-system (found it was needed when 'yum-utils' replaced 'dnf-utils' in RHEL 8.1 release).

Signed-off-by: Digimer <digimer@alteeve.ca>
main
Digimer 5 years ago
parent 70776964d6
commit d0006cc4d3
  1. 30
      Anvil/Tools/Network.pm
  2. 24
      cgi-bin/striker
  3. 4
      tools/anvil-update-states
  4. 2
      tools/anvil-update-system

@ -926,15 +926,15 @@ AND
# We'll initially load empty strings for what would be the IP information. Any interface with IPs will be populated when we call
$anvil->data->{network}{$host}{interface}{$bridge_name}{uuid} = $bridge_uuid;
$anvil->data->{network}{$host}{interface}{$bridge_name}{id} = $bridge_id;
$anvil->data->{network}{$host}{interface}{$bridge_name}{mac} = $bridge_mac_address;
$anvil->data->{network}{$host}{interface}{$bridge_name}{mac_address} = $bridge_mac_address;
$anvil->data->{network}{$host}{interface}{$bridge_name}{mtu} = $bridge_mtu;
$anvil->data->{network}{$host}{interface}{$bridge_name}{stp_enabled} = $bridge_mtu;
$anvil->data->{network}{$host}{interface}{$bridge_name}{stp_enabled} = $bridge_stp_enabled;
$anvil->data->{network}{$host}{interface}{$bridge_name}{type} = "bridge";
$anvil->data->{network}{$host}{interface}{$bridge_name}{interfaces} = [];
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $debug, list => {
"network::${host}::interface::${bridge_name}::uuid" => $anvil->data->{network}{$host}{interface}{$bridge_name}{uuid},
"network::${host}::interface::${bridge_name}::id" => $anvil->data->{network}{$host}{interface}{$bridge_name}{id},
"network::${host}::interface::${bridge_name}::mac" => $anvil->data->{network}{$host}{interface}{$bridge_name}{mac},
"network::${host}::interface::${bridge_name}::mac_address" => $anvil->data->{network}{$host}{interface}{$bridge_name}{mac_address},
"network::${host}::interface::${bridge_name}::mtu" => $anvil->data->{network}{$host}{interface}{$bridge_name}{mtu},
"network::${host}::interface::${bridge_name}::stp_enabled" => $anvil->data->{network}{$host}{interface}{$bridge_name}{stp_enabled},
"network::${host}::interface::${bridge_name}::type" => $anvil->data->{network}{$host}{interface}{$bridge_name}{type},
@ -1189,7 +1189,7 @@ WHERE
interface_mac => $interface_mac,
}});
$anvil->data->{network}{$host}{interface}{$interface_name}{mac} = $interface_mac;
$anvil->data->{network}{$host}{interface}{$interface_name}{mac_address} = $interface_mac;
$anvil->data->{network}{$host}{interface}{$interface_name}{ip} = $ip_address_address;
$anvil->data->{network}{$host}{interface}{$interface_name}{subnet} = $ip_address_subnet_mask;
$anvil->data->{network}{$host}{interface}{$interface_name}{default_gateway} = $ip_address_default_gateway;
@ -1197,7 +1197,7 @@ WHERE
$anvil->data->{network}{$host}{interface}{$interface_name}{dns} = $ip_address_dns;
$anvil->data->{network}{$host}{interface}{$interface_name}{type} = $ip_address_on_type;
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $debug, list => {
"network::${host}::interface::${interface_name}::mac" => $anvil->data->{network}{$host}{interface}{$interface_name}{mac},
"network::${host}::interface::${interface_name}::mac_address" => $anvil->data->{network}{$host}{interface}{$interface_name}{mac_address},
"network::${host}::interface::${interface_name}::ip" => $anvil->data->{network}{$host}{interface}{$interface_name}{ip},
"network::${host}::interface::${interface_name}::subnet" => $anvil->data->{network}{$host}{interface}{$interface_name}{subnet},
"network::${host}::interface::${interface_name}::default_gateway" => $anvil->data->{network}{$host}{interface}{$interface_name}{default_gateway},
@ -1232,7 +1232,7 @@ WHERE
interface_mac => $interface_mac,
}});
$anvil->data->{network}{$host}{interface}{$interface_name}{mac} = $interface_mac;
$anvil->data->{network}{$host}{interface}{$interface_name}{mac_address} = $interface_mac;
$anvil->data->{network}{$host}{interface}{$interface_name}{ip} = $ip_address_address;
$anvil->data->{network}{$host}{interface}{$interface_name}{subnet} = $ip_address_subnet_mask;
$anvil->data->{network}{$host}{interface}{$interface_name}{default_gateway} = $ip_address_default_gateway;
@ -1240,7 +1240,7 @@ WHERE
$anvil->data->{network}{$host}{interface}{$interface_name}{dns} = $ip_address_dns;
$anvil->data->{network}{$host}{interface}{$interface_name}{type} = $ip_address_on_type;
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $debug, list => {
"network::${host}::interface::${interface_name}::mac" => $anvil->data->{network}{$host}{interface}{$interface_name}{mac},
"network::${host}::interface::${interface_name}::mac_address" => $anvil->data->{network}{$host}{interface}{$interface_name}{mac_address},
"network::${host}::interface::${interface_name}::ip" => $anvil->data->{network}{$host}{interface}{$interface_name}{ip},
"network::${host}::interface::${interface_name}::subnet" => $anvil->data->{network}{$host}{interface}{$interface_name}{subnet},
"network::${host}::interface::${interface_name}::default_gateway" => $anvil->data->{network}{$host}{interface}{$interface_name}{default_gateway},
@ -1275,7 +1275,7 @@ WHERE
interface_mac => $interface_mac,
}});
$anvil->data->{network}{$host}{interface}{$interface_name}{mac} = $interface_mac;
$anvil->data->{network}{$host}{interface}{$interface_name}{mac_address} = $interface_mac;
$anvil->data->{network}{$host}{interface}{$interface_name}{ip} = $ip_address_address;
$anvil->data->{network}{$host}{interface}{$interface_name}{subnet} = $ip_address_subnet_mask;
$anvil->data->{network}{$host}{interface}{$interface_name}{default_gateway} = $ip_address_default_gateway;
@ -1283,7 +1283,7 @@ WHERE
$anvil->data->{network}{$host}{interface}{$interface_name}{dns} = $ip_address_dns;
$anvil->data->{network}{$host}{interface}{$interface_name}{type} = $ip_address_on_type;
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $debug, list => {
"network::${host}::interface::${interface_name}::mac" => $anvil->data->{network}{$host}{interface}{$interface_name}{mac},
"network::${host}::interface::${interface_name}::mac_address" => $anvil->data->{network}{$host}{interface}{$interface_name}{mac_address},
"network::${host}::interface::${interface_name}::ip" => $anvil->data->{network}{$host}{interface}{$interface_name}{ip},
"network::${host}::interface::${interface_name}::subnet" => $anvil->data->{network}{$host}{interface}{$interface_name}{subnet},
"network::${host}::interface::${interface_name}::default_gateway" => $anvil->data->{network}{$host}{interface}{$interface_name}{default_gateway},
@ -1404,7 +1404,7 @@ sub get_ips
$anvil->data->{network}{$host}{interface}{$in_iface}{ip} = "" if not defined $anvil->data->{network}{$host}{interface}{$in_iface}{ip};
$anvil->data->{network}{$host}{interface}{$in_iface}{subnet} = "" if not defined $anvil->data->{network}{$host}{interface}{$in_iface}{subnet};
$anvil->data->{network}{$host}{interface}{$in_iface}{mac} = "" if not defined $anvil->data->{network}{$host}{interface}{$in_iface}{mac};
$anvil->data->{network}{$host}{interface}{$in_iface}{mac_address} = "" if not defined $anvil->data->{network}{$host}{interface}{$in_iface}{mac_address};
$anvil->data->{network}{$host}{interface}{$in_iface}{default_gateway} = 0 if not defined $anvil->data->{network}{$host}{interface}{$in_iface}{default_gateway};
$anvil->data->{network}{$host}{interface}{$in_iface}{gateway} = "" if not defined $anvil->data->{network}{$host}{interface}{$in_iface}{gateway};
$anvil->data->{network}{$host}{interface}{$in_iface}{dns} = "" if not defined $anvil->data->{network}{$host}{interface}{$in_iface}{dns};
@ -1439,10 +1439,10 @@ sub get_ips
}
if ($line =~ /ether ([0-9a-f]{2}:[0-9a-f]{2}:[0-9a-f]{2}:[0-9a-f]{2}:[0-9a-f]{2}:[0-9a-f]{2}) /i)
{
my $mac = $1;
$anvil->data->{network}{$host}{interface}{$in_iface}{mac} = $mac;
my $mac_address = $1;
$anvil->data->{network}{$host}{interface}{$in_iface}{mac_address} = $mac_address;
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $debug, list => {
"network::${host}::interface::${in_iface}::mac" => $anvil->data->{network}{$host}{interface}{$in_iface}{mac},
"network::${host}::interface::${in_iface}::mac_address" => $anvil->data->{network}{$host}{interface}{$in_iface}{mac_address},
}});
# We only record the mac in 'network::mac' if this isn't a bond.
@ -1450,9 +1450,9 @@ sub get_ips
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $debug, list => { test_file => $test_file }});
if (not -e $test_file)
{
$anvil->data->{network}{mac}{$mac}{iface} = $in_iface;
$anvil->data->{network}{mac_address}{$mac_address}{iface} = $in_iface;
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $debug, list => {
"network::mac::${mac}::iface" => $anvil->data->{network}{mac}{$mac}{iface},
"network::mac_address::${mac_address}::iface" => $anvil->data->{network}{mac_address}{$mac_address}{iface},
}});
}
}

@ -2596,12 +2596,12 @@ sub sanity_check_step2
else
{
# Valid MAC. Has it been assigned elsewhere?
my $mac = $anvil->data->{cgi}{$this_iface1_key}{value};
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 3, list => { mac => $mac }});
if ((not exists $anvil->data->{network}{$mac}{set_as}) or (not $anvil->data->{network}{$mac}{set_as}))
my $mac_address = $anvil->data->{cgi}{$this_iface1_key}{value};
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 3, list => { mac_address => $mac_address }});
if ((not exists $anvil->data->{network}{$mac_address}{set_as}) or (not $anvil->data->{network}{$mac_address}{set_as}))
{
$anvil->data->{network}{$mac}{set_as} = $this_iface1_key;
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 3, list => { "network::${mac}::set_as" => $anvil->data->{network}{$mac}{set_as} }});
$anvil->data->{network}{$mac_address}{set_as} = $this_iface1_key;
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 3, list => { "network::${mac_address}::set_as" => $anvil->data->{network}{$mac_address}{set_as} }});
# Record the answer.
$anvil->Database->insert_or_update_variables({
@ -2618,7 +2618,7 @@ sub sanity_check_step2
else
{
# Conflict! Set the alert for this interface and the conflicting one.
my $conflict_key = $anvil->data->{network}{$mac}{set_as};
my $conflict_key = $anvil->data->{network}{$mac_address}{set_as};
$anvil->data->{cgi}{$conflict_key}{alert} = 1;
$anvil->data->{cgi}{$this_iface1_key}{alert} = 1;
$anvil->data->{form}{error_massage} = $anvil->Template->get({file => "main.html", name => "error_message", variables => { error_message => $anvil->Words->string({key => "error_0018"}) }});
@ -2644,12 +2644,12 @@ sub sanity_check_step2
else
{
# Valid MAC. Has it been assigned elsewhere?
my $mac = $anvil->data->{cgi}{$this_iface2_key}{value};
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 3, list => { mac => $mac }});
if ((not exists $anvil->data->{network}{$mac}{set_as}) or (not $anvil->data->{network}{$mac}{set_as}))
my $mac_address = $anvil->data->{cgi}{$this_iface2_key}{value};
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 3, list => { mac_address => $mac_address }});
if ((not exists $anvil->data->{network}{$mac_address}{set_as}) or (not $anvil->data->{network}{$mac_address}{set_as}))
{
$anvil->data->{network}{$mac}{set_as} = $this_iface2_key;
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 3, list => { "network::${mac}::set_as" => $anvil->data->{network}{$mac}{set_as} }});
$anvil->data->{network}{$mac_address}{set_as} = $this_iface2_key;
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 3, list => { "network::${mac_address}::set_as" => $anvil->data->{network}{$mac_address}{set_as} }});
# Record the answer.
$anvil->Database->insert_or_update_variables({
@ -2666,7 +2666,7 @@ sub sanity_check_step2
else
{
# Conflict! Set the alert for this interface and the conflicting one.
my $conflict_key = $anvil->data->{network}{$mac}{set_as};
my $conflict_key = $anvil->data->{network}{$mac_address}{set_as};
$anvil->data->{cgi}{$conflict_key}{alert} = 1;
$anvil->data->{cgi}{$this_iface2_key}{alert} = 1;
$anvil->data->{form}{error_massage} = $anvil->Template->get({file => "main.html", name => "error_message", variables => { error_message => $anvil->Words->string({key => "error_0018"}) }});

@ -324,7 +324,7 @@ sub update_network
"network::local::interface::${interface}::duplex" => $anvil->data->{network}{'local'}{interface}{$interface}{duplex},
"network::local::interface::${interface}::ip" => $anvil->data->{network}{'local'}{interface}{$interface}{ip},
"network::local::interface::${interface}::link_state" => $anvil->data->{network}{'local'}{interface}{$interface}{link_state},
"network::local::interface::${interface}::mac" => $anvil->data->{network}{'local'}{interface}{$interface}{mac},
"network::local::interface::${interface}::mac_address" => $anvil->data->{network}{'local'}{interface}{$interface}{mac_address},
"network::local::interface::${interface}::media" => $anvil->data->{network}{'local'}{interface}{$interface}{media},
"network::local::interface::${interface}::mii_polling_interval" => $anvil->data->{network}{'local'}{interface}{$interface}{mii_polling_interval},
"network::local::interface::${interface}::mtu" => $anvil->data->{network}{'local'}{interface}{$interface}{mtu},
@ -366,7 +366,7 @@ sub update_network
my $duplex = $anvil->data->{network}{'local'}{interface}{$interface}{duplex};
my $ip_address = $anvil->data->{network}{'local'}{interface}{$interface}{ip};
my $link_state = $anvil->data->{network}{'local'}{interface}{$interface}{link_state};
my $mac_address = $anvil->data->{network}{'local'}{interface}{$interface}{mac};
my $mac_address = $anvil->data->{network}{'local'}{interface}{$interface}{mac_address};
my $media = $anvil->data->{network}{'local'}{interface}{$interface}{media};
my $mii_polling_interval = $anvil->data->{network}{'local'}{interface}{$interface}{mii_polling_interval};
my $mtu = $anvil->data->{network}{'local'}{interface}{$interface}{mtu};

@ -159,7 +159,7 @@ sub run_os_update
my $next_step = 0;
my $verifying = 0;
my $output = "";
my $shell_call = $anvil->data->{path}{exe}{dnf}." clean expire-cache && ".$anvil->data->{path}{exe}{dnf}." -y update; ".$anvil->data->{path}{exe}{echo}." return_code:\$?";
my $shell_call = $anvil->data->{path}{exe}{dnf}." clean expire-cache && ".$anvil->data->{path}{exe}{dnf}." -y update --best --allowerasing; ".$anvil->data->{path}{exe}{echo}." return_code:\$?";
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 3, list => { shell_call => $shell_call }});
open (my $file_handle, $shell_call." 2>&1 |") or $anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 0, secure => 0, priority => "err", key => "log_0014", variables => { shell_call => $shell_call, error => $! }});
while(<$file_handle>)

Loading…
Cancel
Save