UserInvitations clean up (#1329)

* UserInvitations clean up

This version of Cloud Identity API wants C in customer
I commented it out in case the developers figure out that it's inconsistent with devices and groups

Delete extraneous code

* Update userinvitations.py
This commit is contained in:
Ross Scroggs
2021-03-12 13:03:04 -08:00
committed by GitHub
parent b27c63d0d7
commit f252f757f1

View File

@@ -13,10 +13,7 @@ from gam.gapi import cloudidentity as gapi_cloudidentity
def _get_customerid():
''' returns customer in format needed for this API'''
customer = GC_Values[GC_CUSTOMER_ID]
if customer.startswith('C'):
customer = customer[1:]
return f'customers/{customer}'
return f'customers/{GC_Values[GC_CUSTOMER_ID]}'
def _reduce_name(name):
''' converts long name into email address'''
@@ -33,12 +30,9 @@ def _generic_action(action):
'send': 'Sending'
}
print_action = action_map[action]
kwargs = {}
if action != 'get':
kwargs['body'] = {}
print(f'{print_action} user invite...')
result = gapi.call(svc.customers().userinvitations(), action,
name=name, **kwargs)
name=name)
name = result.get('response', {}).get('name')
if name:
result['response']['name'] = _reduce_name(name)