explicity state customer format for new APIs and cleanup as necessary

This commit is contained in:
Jay Lee
2021-03-12 16:20:20 -05:00
parent 7de1179b7e
commit 5e6f9353c2
2 changed files with 8 additions and 3 deletions

View File

@@ -12,8 +12,11 @@ from gam.gapi import errors as gapi_errors
from gam.gapi import cloudidentity as gapi_cloudidentity
def _get_customerid():
''' returns customer in format needed for this API'''
return f'customers/{GC_Values[GC_CUSTOMER_ID]}'
''' returns customer in "customers/(C){customer_id}' format needed for this API'''
customer = GC_Values[GC_CUSTOMER_ID]
if customer != MY_CUSTOMER and customer[0] != 'C':
customer = 'C' + customer
return f'customers/{customer}'
def _reduce_name(name):
''' converts long name into email address'''

View File

@@ -10,8 +10,10 @@ from gam.gapi.directory import orgunits as gapi_directory_orgunits
def _get_customerid():
''' returns customer in format needed for this API'''
''' returns customer in "customers/C{customer}" format needed for this API'''
customer = GC_Values[GC_CUSTOMER_ID]
if customer != MY_CUSTOMER and customer[0] != 'C':
customer = 'C' + customer
return f'customers/{customer}'
def _get_printer_attributes(i, cdapi=None):