gam7 7.4.0__py3-none-any.whl → 7.4.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of gam7 might be problematic. Click here for more details.

gam/__init__.py CHANGED
@@ -25,7 +25,7 @@ https://github.com/GAM-team/GAM/wiki
25
25
  """
26
26
 
27
27
  __author__ = 'GAM Team <google-apps-manager@googlegroups.com>'
28
- __version__ = '7.04.00'
28
+ __version__ = '7.04.01'
29
29
  __license__ = 'Apache License 2.0 (http://www.apache.org/licenses/LICENSE-2.0)'
30
30
 
31
31
  #pylint: disable=wrong-import-position
@@ -667,8 +667,10 @@ def accessErrorExitNonDirectory(api, errMsg):
667
667
  Ent.API, api])+[errMsg],
668
668
  ''))
669
669
 
670
- def ClientAPIAccessDeniedExit():
670
+ def ClientAPIAccessDeniedExit(errMsg=None):
671
671
  stderrErrorMsg(Msg.API_ACCESS_DENIED)
672
+ if errMsg:
673
+ stderrErrorMsg(errMsg)
672
674
  missingScopes = API.getClientScopesSet(GM.Globals[GM.CURRENT_CLIENT_API])-GM.Globals[GM.CURRENT_CLIENT_API_SCOPES]
673
675
  if missingScopes:
674
676
  writeStderr(Msg.API_CHECK_CLIENT_AUTHORIZATION.format(GM.Globals[GM.OAUTH2_CLIENT_ID],
@@ -21225,6 +21227,8 @@ def _getPeopleOtherContacts(people, entityType, user, i=0, count=0):
21225
21227
  resourceName = contact.pop('resourceName')
21226
21228
  otherContacts[resourceName] = contact
21227
21229
  return otherContacts
21230
+ except GAPI.permissionDenied as e:
21231
+ ClientAPIAccessDeniedExit(str(e))
21228
21232
  except (GAPI.serviceNotAvailable, GAPI.forbidden):
21229
21233
  entityUnknownWarning(entityType, user, i, count)
21230
21234
  return None
@@ -21281,6 +21285,8 @@ def queryPeopleContacts(people, contactQuery, fields, sortOrder, entityType, use
21281
21285
  showMessage = pageMessage.replace(TOTAL_ITEMS_MARKER, str(totalItems))
21282
21286
  writeGotMessage(showMessage.replace('{0}', str(Ent.Choose(Ent.PEOPLE_CONTACT, totalItems))))
21283
21287
  return entityList
21288
+ except GAPI.permissionDenied as e:
21289
+ ClientAPIAccessDeniedExit(str(e))
21284
21290
  except (GAPI.serviceNotAvailable, GAPI.forbidden):
21285
21291
  entityUnknownWarning(entityType, user, i, count)
21286
21292
  return None
@@ -21307,6 +21313,8 @@ def queryPeopleOtherContacts(people, contactQuery, fields, entityType, user, i=0
21307
21313
  showMessage = pageMessage.replace(TOTAL_ITEMS_MARKER, str(totalItems))
21308
21314
  writeGotMessage(showMessage.replace('{0}', str(Ent.Choose(Ent.OTHER_CONTACT, totalItems))))
21309
21315
  return entityList
21316
+ except GAPI.permissionDenied as e:
21317
+ ClientAPIAccessDeniedExit(str(e))
21310
21318
  except (GAPI.serviceNotAvailable, GAPI.forbidden):
21311
21319
  entityUnknownWarning(entityType, user, i, count)
21312
21320
  return None
@@ -21327,6 +21335,8 @@ def getPeopleContactGroupsInfo(people, entityType, entityName, i, count):
21327
21335
  if group['formattedName'] != group['name']:
21328
21336
  contactGroupNames.setdefault(group['name'], [])
21329
21337
  contactGroupNames[group['name']].append(group['resourceName'])
21338
+ except GAPI.permissionDenied as e:
21339
+ ClientAPIAccessDeniedExit(str(e))
21330
21340
  except GAPI.forbidden:
21331
21341
  userPeopleServiceNotEnabledWarning(entityName, i, count)
21332
21342
  return (contactGroupIDs, False)
@@ -21425,6 +21435,8 @@ def createUserPeopleContact(users):
21425
21435
  csvPF.WriteRow(row)
21426
21436
  except GAPI.invalidArgument as e:
21427
21437
  entityActionFailedWarning([entityType, user, peopleEntityType, None], str(e), i, count)
21438
+ except GAPI.permissionDenied as e:
21439
+ ClientAPIAccessDeniedExit(str(e))
21428
21440
  except (GAPI.serviceNotAvailable, GAPI.forbidden):
21429
21441
  ClientAPIAccessDeniedExit()
21430
21442
  if csvPF:
@@ -21588,6 +21600,8 @@ def _clearUpdatePeopleContacts(users, updateContacts):
21588
21600
  entityActionFailedWarning([entityType, user, peopleEntityType, resourceName], str(e), j, jcount)
21589
21601
  except (GAPI.notFound, GAPI.internalError):
21590
21602
  entityActionFailedWarning([entityType, user, peopleEntityType, resourceName], Msg.DOES_NOT_EXIST, j, jcount)
21603
+ except GAPI.permissionDenied as e:
21604
+ ClientAPIAccessDeniedExit(str(e))
21591
21605
  except (GAPI.serviceNotAvailable, GAPI.forbidden):
21592
21606
  ClientAPIAccessDeniedExit()
21593
21607
  Ind.Decrement()
@@ -21736,6 +21750,8 @@ def dedupReplaceDomainUserPeopleContacts(users):
21736
21750
  entityActionFailedWarning([entityType, user, peopleEntityType, resourceName], str(e), j, jcount)
21737
21751
  except (GAPI.notFound, GAPI.internalError):
21738
21752
  entityActionFailedWarning([entityType, user, peopleEntityType, resourceName], Msg.DOES_NOT_EXIST, j, jcount)
21753
+ except GAPI.permissionDenied as e:
21754
+ ClientAPIAccessDeniedExit(str(e))
21739
21755
  except (GAPI.serviceNotAvailable, GAPI.forbidden):
21740
21756
  ClientAPIAccessDeniedExit()
21741
21757
  Ind.Decrement()
@@ -21789,6 +21805,8 @@ def deleteUserPeopleContacts(users):
21789
21805
  entityActionPerformed([entityType, user, peopleEntityType, resourceName], j, jcount)
21790
21806
  except (GAPI.notFound, GAPI.internalError):
21791
21807
  entityActionFailedWarning([entityType, user, peopleEntityType, resourceName], Msg.DOES_NOT_EXIST, j, jcount)
21808
+ except GAPI.permissionDenied as e:
21809
+ ClientAPIAccessDeniedExit(str(e))
21792
21810
  except (GAPI.serviceNotAvailable, GAPI.forbidden):
21793
21811
  ClientAPIAccessDeniedExit()
21794
21812
  Ind.Decrement()
@@ -22067,6 +22085,8 @@ def _infoPeople(users, entityType, source):
22067
22085
  except GAPI.invalidArgument as e:
22068
22086
  entityActionFailedWarning([entityType, user, peopleEntityType, resourceName], str(e), j, jcount)
22069
22087
  continue
22088
+ except GAPI.permissionDenied as e:
22089
+ ClientAPIAccessDeniedExit(str(e))
22070
22090
  except (GAPI.serviceNotAvailable, GAPI.forbidden):
22071
22091
  ClientAPIAccessDeniedExit()
22072
22092
  if showContactGroups and contactGroupIDs:
@@ -22245,6 +22265,8 @@ def copyUserPeopleOtherContacts(users):
22245
22265
  except (GAPI.notFound, GAPI.internalError):
22246
22266
  entityActionFailedWarning([entityType, user, peopleEntityType, resourceName], Msg.DOES_NOT_EXIST, j, jcount)
22247
22267
  continue
22268
+ except GAPI.permissionDenied as e:
22269
+ ClientAPIAccessDeniedExit(str(e))
22248
22270
  except (GAPI.serviceNotAvailable, GAPI.forbidden):
22249
22271
  ClientAPIAccessDeniedExit()
22250
22272
  Ind.Decrement()
@@ -22359,7 +22381,9 @@ def processUserPeopleOtherContacts(users):
22359
22381
  except (GAPI.notFound, GAPI.internalError):
22360
22382
  entityActionFailedWarning([entityType, user, peopleEntityType, resourceName], Msg.DOES_NOT_EXIST, j, jcount)
22361
22383
  continue
22362
- except (GAPI.serviceNotAvailable, GAPI.forbidden, GAPI.permissionDenied):
22384
+ except GAPI.permissionDenied as e:
22385
+ ClientAPIAccessDeniedExit(str(e))
22386
+ except (GAPI.serviceNotAvailable, GAPI.forbidden):
22363
22387
  ClientAPIAccessDeniedExit()
22364
22388
  Ind.Decrement()
22365
22389
 
@@ -22476,6 +22500,8 @@ def _printShowPeople(source):
22476
22500
  pageSize=GC.Values[GC.PEOPLE_MAX_RESULTS],
22477
22501
  sources=sources, mergeSources=mergeSources,
22478
22502
  readMask=fields, fields='nextPageToken,people', **kwargs)
22503
+ except GAPI.permissionDenied as e:
22504
+ ClientAPIAccessDeniedExit(str(e))
22479
22505
  except (GAPI.serviceNotAvailable, GAPI.forbidden):
22480
22506
  ClientAPIAccessDeniedExit()
22481
22507
  if not countsOnly:
@@ -22596,6 +22622,8 @@ def printShowUserPeopleProfiles(users):
22596
22622
  except GAPI.notFound:
22597
22623
  entityUnknownWarning(Ent.PEOPLE_PROFILE, user, i, count)
22598
22624
  continue
22625
+ except GAPI.permissionDenied as e:
22626
+ ClientAPIAccessDeniedExit(str(e))
22599
22627
  except (GAPI.serviceNotAvailable, GAPI.forbidden):
22600
22628
  ClientAPIAccessDeniedExit()
22601
22629
  if not csvPF:
@@ -22750,6 +22778,8 @@ def _processPeopleContactPhotos(users, function):
22750
22778
  entityDoesNotHaveItemWarning([entityType, user, peopleEntityType, resourceName, Ent.PHOTO, filename], j, jcount)
22751
22779
  except (GAPI.invalidArgument, OSError, IOError) as e:
22752
22780
  entityActionFailedWarning([entityType, user, peopleEntityType, resourceName, Ent.PHOTO, filename], str(e), j, jcount)
22781
+ except GAPI.permissionDenied as e:
22782
+ ClientAPIAccessDeniedExit(str(e))
22753
22783
  except (GAPI.serviceNotAvailable, GAPI.forbidden):
22754
22784
  ClientAPIAccessDeniedExit()
22755
22785
  break
@@ -22824,7 +22854,7 @@ def createUserPeopleContactGroup(users):
22824
22854
  if addCSVData:
22825
22855
  row.update(addCSVData)
22826
22856
  csvPF.WriteRow(row)
22827
- except GAPI.forbidden:
22857
+ except (GAPI.forbidden, GAPI.permissionDenied):
22828
22858
  userPeopleServiceNotEnabledWarning(user, i, count)
22829
22859
  except GAPI.serviceNotAvailable:
22830
22860
  entityUnknownWarning(entityType, user, i, count)
@@ -22878,7 +22908,7 @@ def updateUserPeopleContactGroup(users):
22878
22908
  entityActionPerformed([entityType, user, Ent.CONTACT_GROUP, contactGroup], j, jcount)
22879
22909
  except (GAPI.notFound, GAPI.internalError) as e:
22880
22910
  entityActionFailedWarning([entityType, user, Ent.CONTACT_GROUP, contactGroup], str(e), j, jcount)
22881
- except GAPI.forbidden:
22911
+ except (GAPI.forbidden, GAPI.permissionDenied):
22882
22912
  userPeopleServiceNotEnabledWarning(user, i, count)
22883
22913
  break
22884
22914
  except GAPI.serviceNotAvailable:
@@ -22923,7 +22953,7 @@ def deleteUserPeopleContactGroups(users):
22923
22953
  entityActionPerformed([entityType, user, Ent.CONTACT_GROUP, contactGroup], j, jcount)
22924
22954
  except GAPI.notFound as e:
22925
22955
  entityActionFailedWarning([entityType, user, Ent.CONTACT_GROUP, contactGroup], str(e), j, jcount)
22926
- except GAPI.forbidden:
22956
+ except (GAPI.forbidden, GAPI.permissionDenied):
22927
22957
  userPeopleServiceNotEnabledWarning(user, i, count)
22928
22958
  break
22929
22959
  except GAPI.serviceNotAvailable:
@@ -23024,7 +23054,7 @@ def infoUserPeopleContactGroups(users):
23024
23054
  _showContactGroup(entityType, user, Ent.CONTACT_GROUP, group, j, jcount, FJQC)
23025
23055
  except GAPI.notFound as e:
23026
23056
  entityActionFailedWarning([entityType, user, Ent.CONTACT_GROUP, contactGroup], str(e), j, jcount)
23027
- except GAPI.forbidden:
23057
+ except (GAPI.forbidden, GAPI.permissionDenied):
23028
23058
  userPeopleServiceNotEnabledWarning(user, i, count)
23029
23059
  break
23030
23060
  except GAPI.serviceNotAvailable:
@@ -23073,6 +23103,8 @@ def printShowUserPeopleContactGroups(users):
23073
23103
  throwReasons=GAPI.PEOPLE_ACCESS_THROW_REASONS,
23074
23104
  pageSize=GC.Values[GC.PEOPLE_MAX_RESULTS],
23075
23105
  groupFields=fields, fields='nextPageToken,contactGroups')
23106
+ except GAPI.permissionDenied as e:
23107
+ ClientAPIAccessDeniedExit(str(e))
23076
23108
  except (GAPI.serviceNotAvailable, GAPI.forbidden):
23077
23109
  ClientAPIAccessDeniedExit()
23078
23110
  _printPersonEntityList(Ent.PEOPLE_CONTACT_GROUP, entityList, entityType, user, i, count, csvPF, FJQC, parameters, None)
@@ -24143,7 +24175,8 @@ def substituteQueryTimes(queries, queryTimes):
24143
24175
  for i, query in enumerate(queries):
24144
24176
  if query is not None:
24145
24177
  for queryTimeName, queryTimeValue in iter(queryTimes.items()):
24146
- queries[i] = query.replace(f'#{queryTimeName}#', queryTimeValue)
24178
+ query = query.replace(f'#{queryTimeName}#', queryTimeValue)
24179
+ queries[i] = query
24147
24180
 
24148
24181
  # Get CrOS devices from gam.cfg print_cros_ous and print_cros_ous_and_children
24149
24182
  def getCfgCrOSEntities():
@@ -34095,7 +34128,7 @@ def doPrintGroupMembers():
34095
34128
  for name in info['names']:
34096
34129
  if name['metadata']['source']['type'] == sourceType:
34097
34130
  return name['displayName']
34098
- except (GAPI.notFound, GAPI.serviceNotAvailable, GAPI.forbidden):
34131
+ except (GAPI.notFound, GAPI.serviceNotAvailable, GAPI.forbidden, GAPI.permissionDenied):
34099
34132
  pass
34100
34133
  return unknownName
34101
34134
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: gam7
3
- Version: 7.4.0
3
+ Version: 7.4.1
4
4
  Summary: CLI tool to manage Google Workspace
5
5
  Project-URL: Homepage, https://github.com/GAM-team/GAM
6
6
  Project-URL: Issues, https://github.com/GAM-team/GAM/issues
@@ -1,4 +1,4 @@
1
- gam/__init__.py,sha256=siFL0HiLrLvg1EOrtiIs1nFbyYzyAPlsilNd4CGMpXc,3470144
1
+ gam/__init__.py,sha256=TVtDzftfoUVfeees4B_zmjxR3QmMDByRTKrN_qzBdN4,3471510
2
2
  gam/__main__.py,sha256=amz0-959ph6zkZKqjaar4n60yho-T37w6qWI36qx0CA,1049
3
3
  gam/cacerts.pem,sha256=nJuWha0xm5dHw_5ptGphwRoO-r36Ccpqiww9pCEDbSc,67484
4
4
  gam/cbcm-v1.1beta1.json,sha256=xO5XloCQQULmPbFBx5bckdqmbLFQ7sJ2TImhE1ysDIY,19439
@@ -66,8 +66,8 @@ gam/googleapiclient/discovery_cache/base.py,sha256=yCDPtxnbNN-p5_9fzBacC6P3wcUPl
66
66
  gam/googleapiclient/discovery_cache/file_cache.py,sha256=sim3Mg4HgRYo3vX75jvcKy_aV568EvIrtBfvfbw-044,4774
67
67
  gam/iso8601/__init__.py,sha256=Z2PsYbXgAH5a5xzUvgczCboPzqWpm65kRcIngCnhViU,1218
68
68
  gam/iso8601/iso8601.py,sha256=Li2FHZ4sBTWuthuQhyCvmvj0j6At8JbGzkSv2fc2RHU,4384
69
- gam7-7.4.0.dist-info/METADATA,sha256=OkqtLXKZQjbP8QM5bYvqx65hXnReESoLPIye8I64V4A,2888
70
- gam7-7.4.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
71
- gam7-7.4.0.dist-info/entry_points.txt,sha256=HVUM5J7dA8YwvJfG30jiLefR19ExMs387TWugWd9sf4,42
72
- gam7-7.4.0.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
73
- gam7-7.4.0.dist-info/RECORD,,
69
+ gam7-7.4.1.dist-info/METADATA,sha256=CtD82jtdLbj0wYtnKS0VoRQ0xCwE4rO-_PDDKjONh9g,2888
70
+ gam7-7.4.1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
71
+ gam7-7.4.1.dist-info/entry_points.txt,sha256=HVUM5J7dA8YwvJfG30jiLefR19ExMs387TWugWd9sf4,42
72
+ gam7-7.4.1.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
73
+ gam7-7.4.1.dist-info/RECORD,,
File without changes