Fixed bug in gam <UserTypeEntity> show webmastersites that caused a trap.

This commit is contained in:
Ross Scroggs
2025-07-29 17:54:45 -07:00
parent 5f55bcc812
commit 904292ded3
2 changed files with 16 additions and 6 deletions

View File

@@ -1,3 +1,7 @@
7.17.01
Fixed bug in `gam <UserTypeEntity> show webmastersites` that caused a trap.
7.17.00 7.17.00
Added commands to discover Sites and WebResources that managed users (previously unmanaged) may have access to for better governance and visibility. Added commands to discover Sites and WebResources that managed users (previously unmanaged) may have access to for better governance and visibility.

View File

@@ -25,7 +25,7 @@ https://github.com/GAM-team/GAM/wiki
""" """
__author__ = 'GAM Team <google-apps-manager@googlegroups.com>' __author__ = 'GAM Team <google-apps-manager@googlegroups.com>'
__version__ = '7.17.00' __version__ = '7.17.01'
__license__ = 'Apache License 2.0 (http://www.apache.org/licenses/LICENSE-2.0)' __license__ = 'Apache License 2.0 (http://www.apache.org/licenses/LICENSE-2.0)'
#pylint: disable=wrong-import-position #pylint: disable=wrong-import-position
@@ -46963,8 +46963,8 @@ def doCreateSiteVerification():
printKeyValueList(['Meta HTML Header Data', webserver_meta_record['token']]) printKeyValueList(['Meta HTML Header Data', webserver_meta_record['token']])
printBlankLine() printBlankLine()
def _showSiteVerificationInfo(site): def _showSiteVerificationInfo(site, i=0, count=0):
printKeyValueList(['Site', site['site']['identifier']]) printKeyValueListWithCount(['Site', site['site']['identifier']], i, count)
Ind.Increment() Ind.Increment()
printKeyValueList(['ID', unquote(site['id'])]) printKeyValueList(['ID', unquote(site['id'])])
printKeyValueList(['Type', site['site']['type']]) printKeyValueList(['Type', site['site']['type']])
@@ -47072,8 +47072,11 @@ def doInfoSiteVerification():
checkForExtraneousArguments() checkForExtraneousArguments()
sites = callGAPIitems(verif.webResource(), 'list', 'items') sites = callGAPIitems(verif.webResource(), 'list', 'items')
if sites: if sites:
count = len(sites)
i = 0
for site in sorted(sites, key=lambda k: (k['site']['type'], k['site']['identifier'])): for site in sorted(sites, key=lambda k: (k['site']['type'], k['site']['identifier'])):
_showSiteVerificationInfo(site) i += 1
_showSiteVerificationInfo(site, i, count)
else: else:
printKeyValueList(['No Sites Verified.']) printKeyValueList(['No Sites Verified.'])
@@ -47101,7 +47104,7 @@ def printShowWebResources(users):
j = 0 j = 0
for site in sorted(sites, key=lambda k: (k['site']['type'], k['site']['identifier'])): for site in sorted(sites, key=lambda k: (k['site']['type'], k['site']['identifier'])):
j += 1 j += 1
_showSiteVerificationInfo(site) _showSiteVerificationInfo(site, j, jcount)
Ind.Decrement() Ind.Decrement()
else: else:
for site in sites: for site in sites:
@@ -47134,7 +47137,10 @@ def printShowWebMasterSites(users):
j = 0 j = 0
for site in sorted(sites, key=lambda k: k['siteUrl']): for site in sorted(sites, key=lambda k: k['siteUrl']):
j += 1 j += 1
_showSiteVerificationInfo(site) printKeyValueListWithCount(['Site', site['siteUrl']], j, jcount)
Ind.Increment()
printKeyValueList(['permissionLevel', site['permissionLevel']])
Ind.Decrement()
Ind.Decrement() Ind.Decrement()
else: else:
for site in sites: for site in sites: