5 def get_command(command):
6 def find_sbin_command(command, exception):
7 search_paths = ['/usr/local/sbin', '/usr/sbin', '/sbin']
8 for fullpath in map(lambda x: "%s/%s" % (x, command), search_paths):
9 if os.path.exists(fullpath) and os.access(fullpath, os.X_OK):
10 return pbs.Command(fullpath)
14 return pbs.__getattr__(command)
15 except pbs.CommadNotFount as e:
16 return find_sbin_command(command, e)