Changeset 167 for trunk/klask


Ignore:
Timestamp:
Jul 11, 2016, 5:20:46 PM (8 years ago)
Author:
g7moreau
Message:
  • No need anymore get_human_readable...
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/klask

    r166 r167  
    425425         }
    426426
    427       my $swport = $result->{$research1};
    428       my $swport_hr = snmp_get_swithport_hr($session, $swport);
     427      my $swport_num = $result->{$research1};
     428      my $swport_hr = get_human_readable_port($sw->{model}, snmp_get_swithport_hr($session, $swport_num));
    429429
    430430      $session->close;
     
    437437      # 21->24 45->48
    438438      SWITCH_PORT_IGNORE:
    439       for my $p (@{$sw->{portignore}}) {
    440          next SWITCH_PORT_IGNORE if $swport_hr ne get_numerical_port($sw->{model},$p);
    441          next LOOP_ON_SWITCH;
     439      for my $portignore (@{$sw->{portignore}}) {
     440         next LOOP_ON_SWITCH if $swport_hr eq $portignore;
    442441         }
    443442
    444443      $ret{switch_hostname}    = $sw->{hostname};
    445444      $ret{switch_description} = $sw->{description};
    446       $ret{switch_port}        = get_human_readable_port($sw->{model}, $swport); # $swport;
     445      $ret{switch_port}        = $swport_num;
    447446      $ret{switch_port_hr}     = $swport_hr; # human readable
    448447
     
    480479
    481480      if (defined $result and $result->{$research1} ne 'noSuchInstance') {
    482          my $swport = $result->{$research1};
    483          my $swport_hr = snmp_get_swithport_hr($session, $swport);
     481         my $swport_num = $result->{$research1};
     482         my $swport_hr = get_human_readable_port($sw->{model}, snmp_get_swithport_hr($session, $swport_num));
    484483
    485484         $ret->{$sw->{hostname}} = {};
    486485         $ret->{$sw->{hostname}}{hostname}    = $sw->{hostname};
    487486         $ret->{$sw->{hostname}}{description} = $sw->{description};
    488          $ret->{$sw->{hostname}}{port}        = get_human_readable_port($sw->{model}, $swport);
     487         $ret->{$sw->{hostname}}{port}        = $swport_num;
    489488         $ret->{$sw->{hostname}}{port_hr}     = $swport_hr;
    490489
     
    568567   my $sw_model = shift;
    569568   my $sw_port  = shift;
     569
     570   # Not need anymore
     571   # get port name by snmp
     572   return $sw_port;
    570573
    571574   if ($sw_model eq 'HP8000M') {
Note: See TracChangeset for help on using the changeset viewer.