From 25fdd76af0262d9584e1bf517ee43797fa6497ef Mon Sep 17 00:00:00 2001 From: Ross Scroggs Date: Tue, 3 Dec 2024 20:12:27 -0800 Subject: [PATCH] Update projectId processing With `PROJECTID_PATTERN = re.compile(r'^[a-z][a-z0-9-]{4,99}[a-z0-9]$')`, the max projectid length is 101 Delete debugging prints --- src/gam/__init__.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/gam/__init__.py b/src/gam/__init__.py index dd1f30d58..a5dfa9b09 100755 --- a/src/gam/__init__.py +++ b/src/gam/__init__.py @@ -11472,7 +11472,6 @@ def _generateProjectSvcAcctId(prefix): return f'{prefix}-{"".join(random.choice(LOWERNUMERIC_CHARS) for _ in range(5))}' def _getLoginHintProjectInfo(createCmd): - print('a') login_hint = None create_key = True appInfo = {'applicationTitle': '', 'supportEmail': ''} @@ -11485,9 +11484,7 @@ def _getLoginHintProjectInfo(createCmd): if login_hint and login_hint.find('@') == -1: Cmd.Backup() login_hint = None - print(1) - projectInfo['projectId'] = getString(Cmd.OB_STRING, optional=True, minLen=6, maxLen=999999).strip() - print(2) + projectInfo['projectId'] = getString(Cmd.OB_STRING, optional=True, minLen=6, maxLen=101).strip() if projectInfo['projectId']: _checkProjectId(projectInfo['projectId']) checkForExtraneousArguments() @@ -11499,7 +11496,7 @@ def _getLoginHintProjectInfo(createCmd): elif myarg == 'nokey': create_key = False elif myarg == 'project': - projectInfo['projectId'] = getString(Cmd.OB_STRING, minLen=6, maxLen=9999) + projectInfo['projectId'] = getString(Cmd.OB_STRING, minLen=6, maxLen=101) _checkProjectId(projectInfo['projectId']) elif createCmd and myarg == 'parent': projectInfo['parent'] = getString(Cmd.OB_STRING) @@ -11515,7 +11512,6 @@ def _getLoginHintProjectInfo(createCmd): break else: unknownArgumentExit() - print(4) if not projectInfo['projectId']: if createCmd: projectInfo['projectId'] = _generateProjectSvcAcctId('gam-project')