diff --git a/src/GamCommands.txt b/src/GamCommands.txt index 47707ced..0b4a641e 100644 --- a/src/GamCommands.txt +++ b/src/GamCommands.txt @@ -1488,6 +1488,9 @@ gam update feature name gam delete feature gam print features [todrive] +gam show oushareddrives|orgunitshareddrives [ou|org|orgunit ] +gam print oushareddrives|orgunitshareddrives [todrive] [ou|org|orgunit ] + gam create resource * gam update resource * gam delete resource diff --git a/src/gam/gapi/cloudidentity/orgunits.py b/src/gam/gapi/cloudidentity/orgunits.py index 7839fa0f..6b9ee2cb 100644 --- a/src/gam/gapi/cloudidentity/orgunits.py +++ b/src/gam/gapi/cloudidentity/orgunits.py @@ -33,22 +33,22 @@ def move_shared_drive(driveId, orgUnit): body=body) def printshow_orgunit_shared_drives(csvFormat): - try: - orgunit = sys.argv[3] - except IndexError: - orgunit = '/' + orgunit = '/' if csvFormat: todrive = False csvRows = [] titles = ['name'] - i = 4 + i = 3 while i < len(sys.argv): myarg = sys.argv[i].lower() if csvFormat and myarg == 'todrive': todrive = True i += 1 - else: - controlflow.invalid_argument_exit(sys.argv[i], + elif myarg in ['ou', 'org', 'orgunit']: + orgunit = sys.argv[i + 1] + i += 2 + else: + controlflow.invalid_argument_exit(sys.argv[i], f"gam {['show', 'print'][csvFormat]} oushareddrives") ci = gapi_cloudidentity.build('cloudidentity_beta') _, orgUnitId = gapi_directory_orgunits.getOrgUnitId(orgunit)