Make print|show oushareddrives consistent with other commands (#1507)

This commit is contained in:
Ross Scroggs
2022-04-08 12:13:04 -07:00
committed by GitHub
parent eb9ca5eb1d
commit a440cbbbdc
2 changed files with 10 additions and 7 deletions

View File

@@ -1488,6 +1488,9 @@ gam update feature <Name> name <Name>
gam delete feature <Name>
gam print features [todrive]
gam show oushareddrives|orgunitshareddrives [ou|org|orgunit <OrgUnitItem>]
gam print oushareddrives|orgunitshareddrives [todrive] [ou|org|orgunit <OrgUnitItem>]
gam create resource <ResourceID> <Name> <ResourceAttribute>*
gam update resource <ResourceID> <ResourceAttribute>*
gam delete resource <ResourceID>

View File

@@ -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)