Skip to content

Commit

Permalink
ENH: specify required fields when retrieving available gcp projects (#…
Browse files Browse the repository at this point in the history
…2008)

Co-authored-by: eskild <[email protected]>
  • Loading branch information
fangchenli and iameskild authored Sep 14, 2023
1 parent d48b38e commit aab5f3f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/_nebari/provider/cloud/google_cloud.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,10 @@ def check_credentials():
def projects() -> Dict[str, str]:
"""Return a dict of available projects."""
check_credentials()
output = subprocess.check_output(["gcloud", "projects", "list", "--format=json"])
data = json.loads(output.decode("utf-8"))
output = subprocess.check_output(
["gcloud", "projects", "list", "--format=json(name,projectId)"]
)
data = json.loads(output)
return {_["name"]: _["projectId"] for _ in data}


Expand Down

0 comments on commit aab5f3f

Please sign in to comment.