portmod: fixes poor use of use pragma, fixes load command, quieter

This commit is contained in:
Jed Reynolds
2020-03-12 15:45:08 -07:00
parent c863ec5a28
commit b9aa0b5efa

View File

@@ -20,12 +20,11 @@ package main;
use strict; use strict;
use warnings; use warnings;
use diagnostics; use diagnostics;
if ((defined $ENV{'DEBUG'}) && ($ENV{'DEBUG'} eq "1")) { use Data::Dumper;
use Data::Dumper; use Carp;
use Carp; $SIG{ __DIE__ } = sub { Carp::confess( @_ ) };
$SIG{ __DIE__ } = sub { Carp::confess( @_ ) }; $SIG{ __WARN__ } = sub { Carp::confess( @_ ) };
$SIG{ __WARN__ } = sub { Carp::confess( @_ ) };
}
# Un-buffer output # Un-buffer output
$| = 1; $| = 1;
@@ -247,7 +246,7 @@ if ($stats_from_file eq "") {
# Configure our utils. # Configure our utils.
$::utils = new LANforge::Utils(); $::utils = new LANforge::Utils();
my $t = $::utils->connect($lfmgr_host, $lfmgr_port); my $t = $::utils->connect($lfmgr_host, $lfmgr_port);
$::utils->sleep_ms(10);
if ($::utils->isQuiet()) { if ($::utils->isQuiet()) {
if (defined $ENV{'LOG_CLI'} && $ENV{'LOG_CLI'} ne "") { if (defined $ENV{'LOG_CLI'} && $ENV{'LOG_CLI'} ne "") {
$::utils->cli_send_silent(0); $::utils->cli_send_silent(0);
@@ -376,8 +375,8 @@ if ($cli_cmd ne "") {
if ($load ne "") { if ($load ne "") {
$cli_cmd = "load $load overwrite"; $cli_cmd = "load $load overwrite";
$::utils->doCmd($cli_cmd); my @rslt = $::utils->doAsyncCmd($cli_cmd);
my @rslt = $t->waitfor("/LOAD-DB: Load attempt has been completed./"); # $t->waitfor("/LOAD-DB: Load attempt has been completed./");
if (!$::utils->isQuiet()) { if (!$::utils->isQuiet()) {
print @rslt; print @rslt;
print "\n"; print "\n";
@@ -389,7 +388,6 @@ if ($load ne "") {
if ((defined $list_port_names) && ($list_port_names ne "")) { if ((defined $list_port_names) && ($list_port_names ne "")) {
my @lines =split("\n", $::utils->doAsyncCmd("nc_show_ports 1 $card all")); my @lines =split("\n", $::utils->doAsyncCmd("nc_show_ports 1 $card all"));
print "---------------------------- ~x:\n";
my $note = ""; my $note = "";
my $eid = ""; my $eid = "";
my $ip = ""; my $ip = "";