search_paths = ['/usr/local/sbin', '/usr/sbin', '/sbin']
for fullpath in map(lambda x: "%s/%s" % (x, command), search_paths):
if os.path.exists(fullpath) and os.access(fullpath, os.X_OK):
search_paths = ['/usr/local/sbin', '/usr/sbin', '/sbin']
for fullpath in map(lambda x: "%s/%s" % (x, command), search_paths):
if os.path.exists(fullpath) and os.access(fullpath, os.X_OK):