Changeset 46 for trunk


Ignore:
Timestamp:
Jul 23, 2009, 12:13:01 AM (15 years ago)
Author:
g7moreau
Message:
  • Before pass test : perlcritic klask
  • Now pass : perlcritic -4 klask
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/klask

    r45 r46  
    114114   die "Configuration file $KLASK_CFG_FILE does not exists. Klask need it !\n" if not -e "$KLASK_CFG_FILE";
    115115   die "Var folder $KLASK_VAR does not exists. Klask need it !\n"              if not -d "$KLASK_VAR";
     116   return;
    116117   }
    117118
    118119sub test_switchdb_environnement {
    119120   die "Switch database $KLASK_SW_FILE does not exists. Launch updatesw before this command !\n" if not -e "$KLASK_SW_FILE";
     121   return;
    120122   }
    121123
    122124sub test_maindb_environnement {
    123125   die "Main database $KLASK_DB_FILE does not exists. Launch updatedb before this command !\n" if not -e "$KLASK_DB_FILE";
     126   return;
    124127   }
    125128
     
    128131sub fastping {
    129132   system "fping -c 1 @_ >/dev/null 2>&1";
     133   return;
    130134   }
    131135
     
    277281
    278282   print "\n" if $verbose;
     283   return;
    279284   }
    280285
     
    514519 klask status  switch port
    515520END
     521   return;
    516522   }
    517523
     
    526532   print ' $Date$'."\n";
    527533   print ' $Id$'."\n";
     534   return;
    528535   }
    529536
     
    539546         unless $where{switch_description} eq 'unknow' and $resol_arp{hostname_fq} eq 'unknow' and $resol_arp{mac_address} eq 'unknow';
    540547      }
     548   return;
    541549   }
    542550
     
    567575         $date;
    568576      }
     577   return;
    569578   }
    570579
     
    745754#      print  "arping -c 1 -w 1 -rR -i $interface $one_computer 2>/dev/null\n";
    746755      }
     756   return;
    747757   }
    748758
     
    766776   mkdir "$dirdb", 0755 unless -d "$dirdb";
    767777   YAML::Syck::DumpFile("$KLASK_DB_FILE", $computerdb);
     778   return;
    768779   }
    769780
     
    785796   
    786797   $possible_format{$format}->(@ARGV);
     798   return;
    787799   }
    788800
     
    819831         $date;
    820832      }
     833   return;
    821834   }
    822835
     
    10251038</table>
    10261039END
     1040   return;
    10271041   }
    10281042
     
    10471061      printf "%s: \"%s\"\n", $ip, $sw_location if not $sw_location eq '';
    10481062      }
     1063   return;
    10491064   }
    10501065
     
    10561071   #snmpset -v 1 -c community X.X.X.X 1.3.6.1.2.1.2.2.1.7.NoPort = 2 (down)
    10571072   system "snmpset -v 1 -c public $switch 1.3.6.1.2.1.2.2.1.7.$port = 1";
     1073   return;
    10581074   }
    10591075
     
    10631079   
    10641080   system "snmpset -v 1 -c public $switch 1.3.6.1.2.1.2.2.1.7.$port = 2";
     1081   return;
    10651082   }
    10661083
     
    10701087   
    10711088   system "snmpget -v 1 -c public $switch 1.3.6.1.2.1.2.2.1.7.$port";
     1089   return;
    10721090   }
    10731091
     
    11141132
    11151133   print "Klask find MAC $mac_address on switch $switch_name port $swport\n";
     1134   return;
    11161135   }
    11171136
     
    13011320     
    13021321   YAML::Syck::DumpFile("$KLASK_SW_FILE", $switch_connection);
     1322   return;
    13031323   }
    13041324
     
    13221342   
    13231343   $possible_format{$format}->(@ARGV);
     1344   return;
    13241345   }
    13251346
     
    13571378         }
    13581379      }
     1380   return;
    13591381   }
    13601382
     
    14471469
    14481470print "}\n";
     1471   return;
    14491472   }
    14501473
Note: See TracChangeset for help on using the changeset viewer.