GoogleCloudPlatform / jupyter-extensions

GCP extensions for Jupyter and JupyterLab
Apache License 2.0
53 stars 34 forks source link

Run gcloud in a shell #459

Closed ojarjur closed 1 year ago

ojarjur commented 1 year ago

On some platforms, the gcloud command is provided by a binary named something other than gcloud (e.g. gcloud.com on Windows).

For those platforms, using subprocess to run the command without the shell=True argument will fail because there is no file named gcloud.

Instead, we need to pass in the shell=True argument so that the call to subprocess first resolves which binary corresponds to the gcloud command and then runs that binary.