more debug for orgunits on windows

This commit is contained in:
Jay Lee
2022-11-14 20:49:30 +00:00
parent a7cd88b2be
commit bb6c8dc225

View File

@ -37,7 +37,9 @@ def _getAllParentOrgUnitsForUser(user, cd=None):
def create(): def create():
cd = gapi_directory.build() cd = gapi_directory.build()
print(f'sys.arg: {sys.argv[3]}')
name = getOrgUnitItem(sys.argv[3], pathOnly=True, absolutePath=False) name = getOrgUnitItem(sys.argv[3], pathOnly=True, absolutePath=False)
print(f'name: {name}')
parent = '' parent = ''
body = {} body = {}
i = 4 i = 4
@ -67,6 +69,7 @@ def create():
orgUnitPath = parent + name orgUnitPath = parent + name
else: else:
orgUnitPath = parent + '/' + name orgUnitPath = parent + '/' + name
print(f'orgunitPath: {orgUnitPath}')
if orgUnitPath.count('/') > 1: if orgUnitPath.count('/') > 1:
body['parentOrgUnitPath'], body['name'] = orgUnitPath.rsplit('/', 1) body['parentOrgUnitPath'], body['name'] = orgUnitPath.rsplit('/', 1)
else: else:
@ -74,7 +77,7 @@ def create():
body['name'] = orgUnitPath[1:] body['name'] = orgUnitPath[1:]
parent = body['parentOrgUnitPath'] parent = body['parentOrgUnitPath']
print('DEBUG DEBUG DEBUG') print('DEBUG DEBUG DEBUG')
print(body) print(f'body: {body}')
gapi.call(cd.orgunits(), gapi.call(cd.orgunits(),
'insert', 'insert',
customerId=GC_Values[GC_CUSTOMER_ID], customerId=GC_Values[GC_CUSTOMER_ID],