Changeset 124
- Timestamp:
- Apr 21, 2013, 10:56:00 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/klask
r123 r124 348 348 349 349 my $result = $session->get_request( 350 -varbindlist => [$research1 , $research2]350 -varbindlist => [$research1] 351 351 ); 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')) { 353 360 $session->close; 354 361 next LOOP_ON_SWITCH; … … 356 363 357 364 my $swport = $result->{$research1}; 358 $swport = $result->{$research2} if $result->{$research1} eq 'noSuchInstance';359 365 $session->close; 360 366 … … 409 415 410 416 my $result = $session->get_request( 411 -varbindlist => [$research1 , $research2]417 -varbindlist => [$research1] 412 418 ); 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') { 415 427 my $swport = $result->{$research1}; 416 $swport = $result->{$research2} if $result->{$research1} eq 'noSuchInstance';417 428 418 429 $ret->{$sw->{hostname}} = {}; … … 1524 1535 1525 1536 my $result = $session->get_request( 1526 -varbindlist => [$research1 , $research2]1537 -varbindlist => [$research1] 1527 1538 ); 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') { 1530 1547 my $swport = $result->{$research1}; 1531 $swport = $result->{$research2} if $result->{$research1} eq 'noSuchInstance';1532 1548 print "Klask find MAC $mac_address on switch $sw_name port $swport\n"; 1533 1549 }
Note: See TracChangeset
for help on using the changeset viewer.