Skip to content

Commit

Permalink
Use constant for project key.
Browse files Browse the repository at this point in the history
  • Loading branch information
daspecster committed May 27, 2016
1 parent 411ac9a commit 4c686be
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions gcloud/_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
(?P<nanos>\d{1,9}) # nanoseconds, maybe truncated
Z # Zulu
""", re.VERBOSE)
_PROJECT_KEY = 'project = '


class _LocalStack(Local):
Expand Down Expand Up @@ -191,8 +192,8 @@ def _default_service_project_id():
gcloud_project_conf = gcloud_project_conf.split('\n')

for key in gcloud_project_conf:
if key.startswith('project = '):
return key[10:]
if key.startswith(_PROJECT_KEY):
return key[len(_PROJECT_KEY):]

return None

Expand Down

0 comments on commit 4c686be

Please sign in to comment.