2017-06-28 10 views
0

私のビルドログは言う:Pythonのサブプロセスはチームシティービルドステップでは動作しませんFileNotFoundError

[10:43:14] [Step 1/1] subprocess.Popen(cmd) 
[10:43:14] [Step 1/1] File "c:\python34\lib\subprocess.py", line 859, in __init__ 
[10:43:14] [Step 1/1] restore_signals, start_new_session) 
[10:43:14] [Step 1/1] File "c:\python34\lib\subprocess.py", line 1114, in _execute_child 
[10:43:14] [Step 1/1] startupinfo) 
[10:43:14] [Step 1/1] FileNotFoundError: [WinError 2] The system cannot find the file specified 

コード:

cmd = r'curl -H "Content-Type: application/json" -X POST -u username:pw --data @{filename} https://(jira-base-url)/rest/raven/1.0/import/execution/cucumber -H "Accept-Content: application/json"'.format(filename=filename) 
subprocess.Popen(cmd) 

私は、サーバーに接続され、上の同じPythonスクリプトを実行してきましたチーム都市の作業ディレクトリと同じディレクトリにあるサーバー、それは動作します。したがって、ファイルは存在します。助言がありますか?

答えて

0

見つけようとしているファイルのパスは、TeamCityビルドの作業ディレクトリに関連している必要があります。理想的には、サーバーのフルパスです。ファイルが存在するため、考えられる原因は、コードに「ファイル名」と指定したパス/値です。

関連する問題