0
在我的剧本我有以下行:的Python:subprocess.Popen返回OSERROR:[错误2]没有这样的文件或目录
proc = subprocess.Popen(["qstat", "-xml", "-u", "*", "-r", "-s", "r"], stdout=subprocess.PIPE)
当我运行它,它工作正常,但是当它被设置作为一个cronjob我回来了:
Traceback (most recent call last): File
File "/seq/software/current/bin/createOpsDashboard.py", line 171,
in get_pod_occupied_slots
proc = subprocess.Popen(["qstat", "-xml", "-u", "*", "-r", "-s", "r"], stdout=subprocess.PIPE)
File "/software/free/Linux/redhat_5_x86_64/pkgs/python_2.7.1-sqlite3-rtrees/lib/python2.7/subprocess.py", line 672, in __init__ errread, errwrite)
File "/software/free/Linux/redhat_5_x86_64/pkgs/python_2.7.1-sqlite3-rtrees/lib/python2.7/subprocess.py", line 1202, in _execute_child
raise child_exception
OSError: [Errno 2] No such file or directory
这是什么原因造成的? cronjob正在调用一个加载Python-2.7的shell脚本,然后调用真实脚本。
莫非文件权限问题? – jcfollower
无关(搭配chmod 755还是什么?):你确定你想通过''的*字面上代替'glob.glob( '*')'? – jfs