mirror of
https://github.com/GAM-team/GAM.git
synced 2026-07-03 20:31:35 +00:00
consolidate license info
This commit is contained in:
56
src/gam.py
56
src/gam.py
@@ -4576,43 +4576,13 @@ def getImap(users):
|
|||||||
print u'User: {0}, IMAP Enabled: {1} ({2}/{3})'.format(user, enabled, i, count)
|
print u'User: {0}, IMAP Enabled: {1} ({2}/{3})'.format(user, enabled, i, count)
|
||||||
|
|
||||||
def getProductAndSKU(sku):
|
def getProductAndSKU(sku):
|
||||||
if sku.lower() in [u'apps', u'gafb', u'gafw', u'gsbasic']:
|
product = None
|
||||||
sku = u'Google-Apps-For-Business'
|
for a_sku, sku_values in SKUS.items():
|
||||||
elif sku.lower() in [u'gafg',]:
|
if sku.lower() in sku_values[u'aliases']:
|
||||||
sku = u'Google-Apps-For-Government'
|
sku = a_sku
|
||||||
elif sku.lower() in [u'gams',]:
|
product = sku_values[u'product']
|
||||||
sku = u'Google-Apps-For-Postini'
|
break
|
||||||
elif sku.lower() in [u'gau', u'unlimited', u'd4w', u'dfw', u'gsbusiness']:
|
if not product:
|
||||||
sku = u'Google-Apps-Unlimited'
|
|
||||||
elif sku.lower() in [u'lite']:
|
|
||||||
sku = u'Google-Apps-Lite'
|
|
||||||
elif sku.lower() == u'coordinate':
|
|
||||||
sku = u'Google-Coordinate'
|
|
||||||
elif sku.lower() == u'vault':
|
|
||||||
sku = u'Google-Vault'
|
|
||||||
elif sku.lower() in [u'vfe',]:
|
|
||||||
sku = u'Google-Vault-Former-Employee'
|
|
||||||
elif sku.lower() in [u'drive-20gb', u'drive20gb', u'20gb']:
|
|
||||||
sku = u'Google-Drive-storage-20GB'
|
|
||||||
elif sku.lower() in [u'drive-50gb', u'drive50gb', u'50gb']:
|
|
||||||
sku = u'Google-Drive-storage-50GB'
|
|
||||||
elif sku.lower() in [u'drive-200gb', u'drive200gb', u'200gb']:
|
|
||||||
sku = u'Google-Drive-storage-200GB'
|
|
||||||
elif sku.lower() in [u'drive-400gb', u'drive400gb', u'400gb']:
|
|
||||||
sku = u'Google-Drive-storage-400GB'
|
|
||||||
elif sku.lower() in [u'drive-1tb', u'drive1tb', u'1tb']:
|
|
||||||
sku = u'Google-Drive-storage-1TB'
|
|
||||||
elif sku.lower() in [u'drive-2tb', u'drive2tb', u'2tb']:
|
|
||||||
sku = u'Google-Drive-storage-2TB'
|
|
||||||
elif sku.lower() in [u'drive-4tb', u'drive4tb', u'4tb']:
|
|
||||||
sku = u'Google-Drive-storage-4TB'
|
|
||||||
elif sku.lower() in [u'drive-4tb', u'drive8tb', u'8tb']:
|
|
||||||
sku = u'Google-Drive-storage-8TB'
|
|
||||||
elif sku.lower() in [u'drive-16tb', u'drive16tb', u'16tb']:
|
|
||||||
sku = u'Google-Drive-storage-16TB'
|
|
||||||
if sku[:20] == u'Google-Drive-storage':
|
|
||||||
product = u'Google-Drive-storage'
|
|
||||||
else:
|
|
||||||
try:
|
try:
|
||||||
product = re.search(u'^([A-Z,a-z]*-[A-Z,a-z]*)', sku).group(1)
|
product = re.search(u'^([A-Z,a-z]*-[A-Z,a-z]*)', sku).group(1)
|
||||||
except AttributeError:
|
except AttributeError:
|
||||||
@@ -7423,12 +7393,7 @@ def doGetUserInfo(user_email=None):
|
|||||||
getSchemas = getAliases = getGroups = getLicenses = True
|
getSchemas = getAliases = getGroups = getLicenses = True
|
||||||
projection = u'full'
|
projection = u'full'
|
||||||
customFieldMask = viewType = None
|
customFieldMask = viewType = None
|
||||||
skus = [u'Google-Apps-For-Business', u'Google-Apps-For-Government', u'Google-Apps-For-Postini',
|
skus = SKUS.keys()
|
||||||
u'Google-Apps-Lite', u'Google-Apps-Unlimited', u'Google-Drive-storage-20GB',
|
|
||||||
u'Google-Drive-storage-50GB', u'Google-Drive-storage-200GB', u'Google-Drive-storage-400GB',
|
|
||||||
u'Google-Drive-storage-1TB', u'Google-Drive-storage-2TB', u'Google-Drive-storage-4TB',
|
|
||||||
u'Google-Drive-storage-8TB', u'Google-Drive-storage-16TB', u'Google-Vault',
|
|
||||||
u'Google-Vault-Former-Employee',]
|
|
||||||
while i < len(sys.argv):
|
while i < len(sys.argv):
|
||||||
myarg = sys.argv[i].lower()
|
myarg = sys.argv[i].lower()
|
||||||
if myarg == u'noaliases':
|
if myarg == u'noaliases':
|
||||||
@@ -9413,7 +9378,10 @@ def doPrintCrosDevices():
|
|||||||
|
|
||||||
def doPrintLicenses(return_list=False, skus=None):
|
def doPrintLicenses(return_list=False, skus=None):
|
||||||
lic = buildGAPIObject(u'licensing')
|
lic = buildGAPIObject(u'licensing')
|
||||||
products = [u'Google-Apps', u'Google-Vault']
|
products = []
|
||||||
|
for sku in SKUS.values():
|
||||||
|
if sku[u'product'] not in products:
|
||||||
|
products.append(sku[u'product'])
|
||||||
licenses = []
|
licenses = []
|
||||||
titles = [u'userId', u'productId', u'skuId']
|
titles = [u'userId', u'productId', u'skuId']
|
||||||
csvRows = []
|
csvRows = []
|
||||||
|
|||||||
35
src/var.py
35
src/var.py
@@ -38,6 +38,41 @@ FN_LAST_UPDATE_CHECK_TXT = u'lastupdatecheck.txt'
|
|||||||
FN_OAUTH2SERVICE_JSON = u'oauth2service.json'
|
FN_OAUTH2SERVICE_JSON = u'oauth2service.json'
|
||||||
FN_OAUTH2_TXT = u'oauth2.txt'
|
FN_OAUTH2_TXT = u'oauth2.txt'
|
||||||
MY_CUSTOMER = u'my_customer'
|
MY_CUSTOMER = u'my_customer'
|
||||||
|
SKUS = {
|
||||||
|
u'Google-Apps-For-Business': {
|
||||||
|
u'product': u'Google-Apps', u'aliases': [u'gafb', u'gafw', u'basic', u'gsuite-basic']},
|
||||||
|
u'Google-Apps-For-Postini': {
|
||||||
|
u'product': u'Google-Apps', u'aliases': [u'gams', u'postini', u'gsuite-gams']},
|
||||||
|
u'Google-Apps-Lite': {
|
||||||
|
u'product': u'Google-Apps', u'aliases': [u'gal', u'lite', u'gsuite-lite']},
|
||||||
|
u'Google-Apps-Unlimited': {
|
||||||
|
u'product': u'Google-Apps', u'aliases': [u'gau', u'unlimited', u'gsuite-business']},
|
||||||
|
u'Google-Drive-storage-20GB': {
|
||||||
|
u'product': u'Google-Drive-storage', u'aliases': [u'drive-20gb', u'drive20gb', u'20gb']},
|
||||||
|
u'Google-Drive-storage-50GB': {
|
||||||
|
u'product': u'Google-Drive-storage', u'aliases': [u'drive-50gb', u'drive50gb', u'50gb']},
|
||||||
|
u'Google-Drive-storage-200GB': {
|
||||||
|
u'product': u'Google-Drive-storage', u'aliases': [u'drive-200gb', u'drive200gb', u'200gb']},
|
||||||
|
u'Google-Drive-storage-400GB': {
|
||||||
|
u'product': u'Google-Drive-storage', u'aliases': [u'drive-400gb', u'drive400gb', u'400gb']},
|
||||||
|
u'Google-Drive-storage-1TB': {
|
||||||
|
u'product': u'Google-Drive-storage', u'aliases': [u'drive-1tb', u'drive1tb', u'1tb']},
|
||||||
|
u'Google-Drive-storage-2TB': {
|
||||||
|
u'product': u'Google-Drive-storage', u'aliases': [u'drive-2tb', u'drive2tb', u'2tb']},
|
||||||
|
u'Google-Drive-storage-4TB': {
|
||||||
|
u'product': u'Google-Drive-storage', u'aliases': [u'drive-4tb', u'drive4tb', u'4tb']},
|
||||||
|
u'Google-Drive-storage-8TB': {
|
||||||
|
u'product': u'Google-Drive-storage', u'aliases': [u'drive-8tb', u'drive8tb', u'8tb']},
|
||||||
|
u'Google-Drive-storage-16TB': {
|
||||||
|
u'product': u'Google-Drive-storage', u'aliases': [u'drive-16tb', u'drive16tb', u'16tb']},
|
||||||
|
u'Google-Vault': {
|
||||||
|
u'product': u'Google-Vault', u'aliases': [u'vault']},
|
||||||
|
u'Google-Vault-Former-Employee': {
|
||||||
|
u'product': u'Google-Vault', u'aliases': [u'vfe']},
|
||||||
|
u'Google-Coordinate': {
|
||||||
|
u'product': u'Google-Coordinate', u'aliases': [u'coordinate']}
|
||||||
|
}
|
||||||
|
|
||||||
#
|
#
|
||||||
# Global variables
|
# Global variables
|
||||||
#
|
#
|
||||||
|
|||||||
Reference in New Issue
Block a user