Back to index

nagios-plugins  1.4.16
Classes | Functions
utils Namespace Reference

Classes

class  error
class  _ready
class  Task
class  TimeoutHandler

Functions

def which

Class Documentation

class utils::error

Definition at line 27 of file utils.py.

class utils::_ready

Definition at line 30 of file utils.py.


Function Documentation

def utils.which (   filename)
Find the file 'filename' in the execution path. If no executable
   file is found, return None

Definition at line 33 of file utils.py.

00033 
00034 def which(filename):
00035     """Find the file 'filename' in the execution path. If no executable
00036        file is found, return None"""
00037     for dir in string.split(os.environ['PATH'],os.pathsep):
00038         fn=os.path.join(dir,filename)
00039         if os.path.exists(fn):
00040             if os.stat(fn)[0]&0111:
00041                 return fn
00042     else:
00043         return None