Skip to content

Commit 4c686be

Browse files
committed
Use constant for project key.
1 parent 411ac9a commit 4c686be

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

gcloud/_helpers.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@
5050
(?P<nanos>\d{1,9}) # nanoseconds, maybe truncated
5151
Z # Zulu
5252
""", re.VERBOSE)
53+
_PROJECT_KEY = 'project = '
5354

5455

5556
class _LocalStack(Local):
@@ -191,8 +192,8 @@ def _default_service_project_id():
191192
gcloud_project_conf = gcloud_project_conf.split('\n')
192193

193194
for key in gcloud_project_conf:
194-
if key.startswith('project = '):
195-
return key[10:]
195+
if key.startswith(_PROJECT_KEY):
196+
return key[len(_PROJECT_KEY):]
196197

197198
return None
198199

0 commit comments

Comments
 (0)