Merge pull request #575 from ylei-tsubame/issues/561-correct-load-ifaces

Rename `Network->load_interfaces`
main
Digimer 11 months ago committed by GitHub
commit c00f90943b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 2
      Anvil/Tools/Database.pm
  2. 10
      Anvil/Tools/Network.pm
  3. 2
      Anvil/Tools/System.pm
  4. 2
      cgi-bin/get_networks
  5. 2
      striker-ui-api/out/index.js
  6. 2
      striker-ui-api/src/lib/accessModule.ts

@ -4365,7 +4365,7 @@ AND
# Read in the IP addresses and network information. Data is loaded under # Read in the IP addresses and network information. Data is loaded under
# 'network::host_uuid::x'. # 'network::host_uuid::x'.
$anvil->Network->load_interfces({debug => $debug, host_uuid => $host_uuid}); $anvil->Network->load_interfaces({debug => $debug, host_uuid => $host_uuid});
} }
return(0); return(0);

@ -28,7 +28,7 @@ my $THIS_FILE = "Network.pm";
# is_local # is_local
# is_our_interface # is_our_interface
# is_ip_in_network # is_ip_in_network
# load_interfces # load_interfaces
# load_ips # load_ips
# manage_firewall # manage_firewall
# modify_connection # modify_connection
@ -2842,7 +2842,7 @@ sub is_ip_in_network
} }
=head2 load_interfces =head2 load_interfaces
This loads all network information for the given host UUID. This loads all network information for the given host UUID.
@ -2867,13 +2867,13 @@ This is the optional C<< target >> string to use in the hash where the data is s
This is the C<< host_uuid >> of the hosts whose IP and interface data that you want to load. The default is to load the local machine's data. This is the C<< host_uuid >> of the hosts whose IP and interface data that you want to load. The default is to load the local machine's data.
=cut =cut
sub load_interfces sub load_interfaces
{ {
my $self = shift; my $self = shift;
my $parameter = shift; my $parameter = shift;
my $anvil = $self->parent; my $anvil = $self->parent;
my $debug = defined $parameter->{debug} ? $parameter->{debug} : 3; my $debug = defined $parameter->{debug} ? $parameter->{debug} : 3;
$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => $debug, key => "log_0125", variables => { method => "Network->load_interfces()" }}); $anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => $debug, key => "log_0125", variables => { method => "Network->load_interfaces()" }});
my $clear = defined $parameter->{clear} ? $parameter->{clear} : 1; my $clear = defined $parameter->{clear} ? $parameter->{clear} : 1;
my $host_uuid = defined $parameter->{host_uuid} ? $parameter->{host_uuid} : $anvil->data->{sys}{host_uuid}; my $host_uuid = defined $parameter->{host_uuid} ? $parameter->{host_uuid} : $anvil->data->{sys}{host_uuid};
@ -2886,7 +2886,7 @@ sub load_interfces
if (not $host_uuid) if (not $host_uuid)
{ {
$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 0, priority => "err", key => "log_0020", variables => { method => "Network->load_interfces()", parameter => "host_uuid" }}); $anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 0, priority => "err", key => "log_0020", variables => { method => "Network->load_interfaces()", parameter => "host_uuid" }});
return(""); return("");
} }

@ -2895,7 +2895,7 @@ sub generate_state_json
"s6:host_key" => $host_key, "s6:host_key" => $host_key,
}}); }});
$anvil->Network->load_interfces({ $anvil->Network->load_interfaces({
debug => $debug, debug => $debug,
host_uuid => $host_uuid, host_uuid => $host_uuid,
host => $short_host_name, host => $short_host_name,

@ -66,7 +66,7 @@ sub get_host_networks
my $host_name = $anvil->data->{hosts}{host_uuid}{$host_uuid}{short_host_name}; my $host_name = $anvil->data->{hosts}{host_uuid}{$host_uuid}{short_host_name};
# Note: the subprocess name matches its definition; there is a typo though. # Note: the subprocess name matches its definition; there is a typo though.
$anvil->Network->load_interfces({ host_uuid => $host_uuid, host => $host_name }); $anvil->Network->load_interfaces({ host_uuid => $host_uuid, host => $host_name });
my $host_networks_data = $anvil->data->{network}{$host_name}; my $host_networks_data = $anvil->data->{network}{$host_name};
my $interfaces = $host_networks_data->{interface}; my $interfaces = $host_networks_data->{interface};

File diff suppressed because one or more lines are too long

@ -411,7 +411,7 @@ const getNetworkData = async (hostUuid: string, hostName?: string) => {
} = await getHostData()); } = await getHostData());
} }
await subroutine('load_interfces', { await subroutine('load_interfaces', {
params: [{ host: replacementKey, host_uuid: hostUuid }], params: [{ host: replacementKey, host_uuid: hostUuid }],
pre: ['Network'], pre: ['Network'],
}); });

Loading…
Cancel
Save