1
我有一個python API,通過bdutil和gcloud命令與現有的Google Compute Engine集羣交互。我試圖在Google App Engine上運行這個API,並且在bdutil和gcloud命令的子進程和os系統執行過程中遇到了一些問題。例如,當本地運行如何在Google App Engine上使用Python中的bdutil和gcloud?
proc = subprocess.Popen(["gcloud compute instances list"],
stdout=subprocess.PIPE, shell=True)
out = proc.communicate()
返回活躍GCE實例的列表,但是當GAE運行失敗,
AttributeError: 'module' object has no attribute 'Popen'
。
我知道第三方庫必須包含在GAE項目中。我也知道上述命令也可能無法應付認證問題。如果可能的話,我正在尋求一個非常詳細的新手關於如何在GAE實例上導入,驗證和執行bdutil和gcloud命令的指令或「hello world」示例。