* Fixed a couple more bugs in tools/anvil-configure-host, getting it now to the point where it writes out the network config files.
Signed-off-by: Digimer <digimer@alteeve.ca>
my $dns = defined $anvil->data->{variables}{form}{config_step2}{dns}{value} ? [split/,/, $anvil->data->{variables}{form}{config_step2}{dns}{value}] : [];
my $dns = defined $anvil->data->{variables}{form}{config_step2}{dns}{value} ? [split/,/, $anvil->data->{variables}{form}{config_step2}{dns}{value}] : [];
@ -298,8 +298,8 @@ sub reconfigure_network
my $link1_mac = $anvil->data->{variables}{form}{config_step2}{$link1_key}{value};
my $link1_mac = $anvil->data->{variables}{form}{config_step2}{$link1_key}{value};
my $is_gateway = $this_network eq $gateway_interface ? 1 : 0;
my $is_gateway = $this_network eq $gateway_interface ? 1 : 0;
my $link2_mac = defined $anvil->data->{variables}{form}{config_step2}{$link2_key}{value} ? $anvil->data->{variables}{form}{config_step2}{$link2_key}{value} : "";
my $link2_mac = defined $anvil->data->{variables}{form}{config_step2}{$link2_key}{value} ? $anvil->data->{variables}{form}{config_step2}{$link2_key}{value} : "";
my $old_link1_iface = $anvil->data->{sys}{mac}{$link1_mac}{iface} ? $anvil->data->{sys}{mac}{$link1_mac}{iface} : "";
my $old_link1_iface = $anvil->data->{network}{mac_address}{$link1_mac}{iface} ? $anvil->data->{network}{mac_address}{$link1_mac}{iface} : "";
my $old_link2_iface = defined $anvil->data->{sys}{mac}{$link2_mac}{iface} ? $anvil->data->{sys}{mac}{$link2_mac}{iface} : "";
my $old_link2_iface = defined $anvil->data->{network}{mac_address}{$link2_mac}{iface} ? $anvil->data->{network}{mac_address}{$link2_mac}{iface} : "";
my $bridge = defined $anvil->data->{variables}{form}{config_step2}{$bridge_key}{value} ? $anvil->data->{variables}{form}{config_step2}{$bridge_key}{value} : 0;
my $bridge = defined $anvil->data->{variables}{form}{config_step2}{$bridge_key}{value} ? $anvil->data->{variables}{form}{config_step2}{$bridge_key}{value} : 0;
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => {
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => {
ip_key => $ip_key,
ip_key => $ip_key,
@ -390,13 +390,13 @@ sub reconfigure_network
my $bond_uuid = get_uuid_from_interface_file($anvil, $bond_file);
my $bond_uuid = get_uuid_from_interface_file($anvil, $bond_file);
my $link1_uuid = get_uuid_from_interface_file($anvil, $old_link1_file);
my $link1_uuid = get_uuid_from_interface_file($anvil, $old_link1_file);
my $link2_uuid = get_uuid_from_interface_file($anvil, $old_link2_file);
my $link2_uuid = get_uuid_from_interface_file($anvil, $old_link2_file);
if ((exists $anvil->data->{sys}{mac}{$link1_mac}{iface}) && ($anvil->data->{sys}{mac}{$link1_mac}{iface}))
if ((exists $anvil->data->{network}{mac_address}{$link1_mac}{iface}) && ($anvil->data->{network}{mac_address}{$link1_mac}{iface}))