Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[READY] - Instrumented Loader.pm use of Ping and Interfaces calls #835

Merged
merged 1 commit into from
Feb 6, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions switch-configuration/config/scripts/Loader.pm
Original file line number Diff line number Diff line change
Expand Up @@ -166,15 +166,19 @@ sub new

STDERR->autoflush(1); # Turn on autoflush for STDERR
get_switchtype("anonymous");


my $ping = Net::Ping->new("icmp"),
print STDERR "Ping OK\n";
my $interfaces = [ Net::Interface->interfaces() ], # List of interfaces
print STDERR "Interfaces OK\n";
my $self = {
ping => Net::Ping->new("icmp"),
ping => $ping,
DefaultIP => "192.168.255.76", # Switch target management IP
line_delay => 100 * 1000, # Delay 100 milliseconds between lines sent to /dev (presumably serial line)
Interfaces => [ Net::Interface->interfaces() ], # List of interfaces
DefaultUser => $user,
asroot => 0,
power_off => 0, # Power off the switch at end of override_switch (default=no)
Interfaces => $interfaces,
DefaultUser => $user,
asroot => 0,
power_off => 0, # Power off the switch at end of override_switch (default=no)
};

foreach my $if (@{$self->{"Interfaces"}})
Expand Down
Loading