Changeset 124 for trunk/klask


Ignore:
Timestamp:
Apr 21, 2013, 10:56:00 AM (11 years ago)
Author:
g7moreau
Message:
  • I think double OID search is now OK !
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/klask

    r123 r124  
    348348
    349349      my $result = $session->get_request(
    350          -varbindlist => [$research1, $research2]
     350         -varbindlist => [$research1]
    351351         );
    352       if (not(defined $result and ($result->{$research1} ne 'noSuchInstance' or $result->{$research2} ne 'noSuchInstance'))) {
     352      if (not defined $result) {
     353         $result = $session->get_request(
     354            -varbindlist => [$research2]
     355            );
     356         $result->{$research1} = $result->{$research2} if defined $result;
     357         }
     358
     359      if (not (defined $result and $result->{$research1} ne 'noSuchInstance')) {
    353360         $session->close;
    354361         next LOOP_ON_SWITCH;
     
    356363
    357364         my $swport = $result->{$research1};
    358          $swport = $result->{$research2} if $result->{$research1} eq 'noSuchInstance';
    359365         $session->close;
    360366
     
    409415
    410416      my $result = $session->get_request(
    411          -varbindlist => [$research1, $research2]
     417         -varbindlist => [$research1]
    412418         );
    413 
    414       if(defined $result and ($result->{$research1} ne 'noSuchInstance' or $result->{$research2} ne 'noSuchInstance')){
     419      if (not defined $result) {
     420         $result = $session->get_request(
     421            -varbindlist => [$research2]
     422            );
     423         $result->{$research1} = $result->{$research2} if defined $result;
     424         }
     425
     426      if (defined $result and $result->{$research1} ne 'noSuchInstance') {
    415427         my $swport = $result->{$research1};
    416          $swport = $result->{$research2} if $result->{$research1} eq 'noSuchInstance';
    417428
    418429         $ret->{$sw->{hostname}} = {};
     
    15241535
    15251536      my $result = $session->get_request(
    1526          -varbindlist => [$research1, $research2]
     1537         -varbindlist => [$research1]
    15271538         );
    1528 
    1529       if (defined $result and ($result->{$research1} ne 'noSuchInstance' or $result->{$research2} ne 'noSuchInstance')) {
     1539      if (not defined $result) {
     1540         $result = $session->get_request(
     1541            -varbindlist => [$research2]
     1542            );
     1543         $result->{$research1} = $result->{$research2} if defined $result;
     1544         }
     1545
     1546      if (defined $result and $result->{$research1} ne 'noSuchInstance') {
    15301547         my $swport = $result->{$research1};
    1531          $swport = $result->{$research2} if $result->{$research1} eq 'noSuchInstance';
    15321548         print "Klask find MAC $mac_address on switch $sw_name port $swport\n";
    15331549         }
Note: See TracChangeset for help on using the changeset viewer.