Skip to content

Commit afca889

Browse files
committed
Further cleanup of gam create|update alias.
1 parent 0cea858 commit afca889

File tree

4 files changed

+18
-11
lines changed

4 files changed

+18
-11
lines changed

src/GamCommands.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1138,9 +1138,9 @@ gam print alertfeedback [todrive <ToDriveAttribute>*] [alert <AlertID>] [filter
11381138
# Aliases
11391139

11401140
gam create|add alias|aliases <EmailAddressEntity> user|group|target <UniqueID>|<EmailAddress>
1141-
[verifynotinvitable] [notargetverify]
1141+
[verifynotinvitable]
11421142
gam update alias|aliases <EmailAddressEntity> user|group|target <UniqueID>|<EmailAddress>
1143-
[verifynotinvitable] [notargetverify]
1143+
[notargetverify]
11441144
gam delete alias|aliases [user|group|target] <EmailAddressEntity>
11451145
gam remove aliases|nicknames <EmailAddress> user|group <EmailAddressEntity>
11461146
gam <UserTypeEntity> delete alias|aliases

src/GamUpdate.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
6.15.19
2+
3+
Further cleanup of `gam create|update alias`.
4+
* See: https://github.com/taers232c/GAMADV-XTD3/wiki/Aliases
5+
16
6.15.18
27

38
After discussions with Jay, the default for creating/updating aliases is to verify that

src/gam/__init__.py

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"""
2626

2727
__author__ = 'Ross Scroggs <[email protected]>'
28-
__version__ = '6.15.18'
28+
__version__ = '6.15.19'
2929
__license__ = 'Apache License 2.0 (http://www.apache.org/licenses/LICENSE-2.0)'
3030

3131
#pylint: disable=wrong-import-position
@@ -9613,9 +9613,9 @@ def doCreateProject():
96139613
sys.stdout.write(Msg.CREATING_PROJECT.format(body['displayName']))
96149614
try:
96159615
create_operation = callGAPI(crm.projects(), 'create',
9616-
throwReasons=[GAPI.BAD_REQUEST, GAPI.ALREADY_EXISTS],
9616+
throwReasons=[GAPI.BAD_REQUEST, GAPI.ALREADY_EXISTS, GAPI.FAILED_PRECONDITION],
96179617
body=body)
9618-
except (GAPI.badRequest, GAPI.alreadyExists) as e:
9618+
except (GAPI.badRequest, GAPI.alreadyExists, GAPI.failedPrecondition) as e:
96199619
entityActionFailedExit([Ent.USER, login_hint, Ent.PROJECT, projectInfo['projectId']], str(e))
96209620
operation_name = create_operation['name']
96219621
time.sleep(5) # Google recommends always waiting at least 5 seconds
@@ -14306,8 +14306,10 @@ def printOrgUnit(parentOrgUnit, tree):
1430614306

1430714307
ALIAS_TARGET_TYPES = ['user', 'group', 'target']
1430814308

14309-
# gam create|update aliases|nicknames <EmailAddressEntity> user|group|target <UniqueID>|<EmailAddress>
14310-
# [verifynotinvitable] [notargetverify]
14309+
# gam create aliases|nicknames <EmailAddressEntity> user|group|target <UniqueID>|<EmailAddress>
14310+
# [verifynotinvitable]
14311+
# gam update aliases|nicknames <EmailAddressEntity> user|group|target <UniqueID>|<EmailAddress>
14312+
# [notargetverify]
1431114313
def doCreateUpdateAliases():
1431214314
def verifyAliasTargetExists():
1431314315
if targetType != 'group':
@@ -14337,12 +14339,12 @@ def verifyAliasTargetExists():
1433714339
targetEmails = getEntityList(Cmd.OB_GROUP_ENTITY)
1433814340
entityLists = targetEmails if isinstance(targetEmails, dict) else None
1433914341
verifyNotInvitable = False
14340-
verifyTarget = True
14342+
verifyTarget = updateCmd
1434114343
while Cmd.ArgumentsRemaining():
1434214344
myarg = getArgument()
14343-
if myarg == 'verifynotinvitable':
14345+
if (not updateCmd) and myarg == 'verifynotinvitable':
1434414346
verifyNotInvitable = True
14345-
elif myarg == 'notargetverify':
14347+
elif updateCmd and myarg == 'notargetverify':
1434614348
verifyTarget = False
1434714349
else:
1434814350
unknownArgumentExit()

src/setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[metadata]
22
name = Advanced GAM for Google Workspace
3-
version = 6.15.18
3+
version = 6.15.19
44
description = Command line management for Google Workspaces
55
long_description = file: readme.md
66
long_description_content_type = text/markdown

0 commit comments

Comments
 (0)