mirror of
https://github.com/GAM-team/GAM.git
synced 2026-07-03 12:21:35 +00:00
fix shareddrive name
This commit is contained in:
3
.github/workflows/build.yml
vendored
3
.github/workflows/build.yml
vendored
@@ -660,7 +660,8 @@ jobs:
|
||||
$gam print caalevels
|
||||
$gam delete caalevel "zzz_${newbase}"
|
||||
$gam user $gam_user add shareddrive "${newbase}"
|
||||
$gam user $gam_user update shareddrive "name:${newbase}" ou "/GitHub Actions Testing"
|
||||
$gam user $gam_user update shareddrive name "${newbase}" ou "/GitHub Actions Testing"
|
||||
$gam user $gam_user delete shareddrive name "${newbase}"
|
||||
$gam user $gam_user show shareddrives asadmin
|
||||
export CUSTOMER_ID="C01wfv983"
|
||||
export GA_DOMAIN="pdl.jaylee.us"
|
||||
|
||||
@@ -8080,14 +8080,16 @@ TEAMDRIVE_RESTRICTIONS_MAP = {
|
||||
|
||||
|
||||
def doUpdateSharedDrive(users):
|
||||
teamDriveId = sys.argv[5]
|
||||
i = 5
|
||||
teamDriveId = sys.argv[i]
|
||||
if teamDriveId.lower().startswith('name'):
|
||||
teamDriveId = gapi_drive_drives.drive_name_to_id(sys.argv[6])
|
||||
i += 1
|
||||
teamDriveId = gapi_drive_drives.drive_name_to_id(sys.argv[i])
|
||||
i += 1
|
||||
body = {}
|
||||
useDomainAdminAccess = False
|
||||
change_hide = None
|
||||
orgUnit = None
|
||||
i = 6
|
||||
while i < len(sys.argv):
|
||||
myarg = sys.argv[i].lower().replace('_', '')
|
||||
if myarg == 'name':
|
||||
@@ -8223,6 +8225,8 @@ def printShowSharedDrives(users, csvFormat):
|
||||
|
||||
def doDeleteSharedDrive(users):
|
||||
teamDriveId = sys.argv[5]
|
||||
if teamDriveId.lower().startswith('name'):
|
||||
teamDriveId = gapi_drive_drives.drive_name_to_id(sys.argv[6])
|
||||
for user in users:
|
||||
user, drive = buildDrive3GAPIObject(user)
|
||||
if not drive:
|
||||
|
||||
@@ -20,7 +20,7 @@ def drive_name_to_id(name, drive=None):
|
||||
q=q,
|
||||
useDomainAdminAccess=True)
|
||||
if len(sds) == 0:
|
||||
controlflow.system_error_exit(f'Could not find shared drive named "{name}"')
|
||||
controlflow.system_error_exit(3, f'Could not find shared drive named "{name}"')
|
||||
elif len(sds) > 1:
|
||||
controlflow.system_error_exit(f'Got more than one shared drive named "{name}"')
|
||||
controlflow.system_error_exit(3, f'Got more than one shared drive named "{name}"')
|
||||
return sds[0]['id']
|
||||
|
||||
Reference in New Issue
Block a user