def GetGcloud(args, project=None, service=None):
"""Get gcloud command with arguments.
Functionalities might be expanded later to run gcloud commands.
Args:
args: command with arguments as an array
project: the project on which the glcoud compute will work
service: the service on gcloud that you want to use. default: compute
Returns:
returns thr formatted command for gcloud compute
"""
command = ["gcloud"]
if service:
command.append(service)
if project:
command.extend(["--project", project])
command.extend(args)
return command
# TODO(sohamcodes): pexpect.spawn can be changed to subprocess call
# However, timeout for subprocess is available only on python3
# So, we can implement it later.
评论列表
文章目录