我写了一些小代码来控制谷歌云平台上的多个计算引擎.整个文件都在github中.
该部分导致的问题gcloud compute ssh
如下
def upload_file(self, projectname):
var = raw_input("Upload file with name: " + projectname + " will remove all file and directory with same name in the instance. Are you sure? (y/n)")
if var.lower().strip() != "y":
print "Abort uploading."
return
is_zip = False
if projectname.split('.')[1] == "zip":
is_zip = True
fullpath_projectname = __location__ + "/" + projectname
if os.path.isfile(fullpath_projectname):
all_instances = self.search_any('instances', filter="labels.type=" + self.working_group_label)
all_instances_name = [x['name'] for x in all_instances]
i = …
Run Code Online (Sandbox Code Playgroud)