From 67cd03d3f1a89f8b9774827742de4b8899bf4d0e Mon Sep 17 00:00:00 2001 From: Ross Scroggs Date: Fri, 26 Jul 2019 06:06:45 -0700 Subject: [PATCH] I suggest match_users instead of if_users (#980) * I suggest match_users instead of if_users * Allow if_users or match_users --- src/GamCommands.txt | 2 +- src/gam.py | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/GamCommands.txt b/src/GamCommands.txt index e7f5410e..d84837c4 100644 --- a/src/GamCommands.txt +++ b/src/GamCommands.txt @@ -1050,7 +1050,7 @@ The listlimit argument limits the number of recent users, time ranges a The start and end arguments filter the time ranges. Delimiter defaults to comma. -gam update mobile action +gam update mobile |query: action [doit] [if_users|match_users ] gam delete mobile gam info mobile gam print mobile [todrive] [(query )|(queries )] [basic|full] [orderby [ascending|descending]] diff --git a/src/gam.py b/src/gam.py index 1fd91fff..4f75dd65 100755 --- a/src/gam.py +++ b/src/gam.py @@ -9693,7 +9693,7 @@ def doUpdateCros(): def doUpdateMobile(): cd = buildGAPIObject('directory') resourceIds = sys.argv[3] - only_users = None + match_users = None doit = False if resourceIds[:6] == 'query:': query = resourceIds[6:] @@ -9714,8 +9714,8 @@ def doUpdateMobile(): if body['action'] not in ['admin_remote_wipe', 'admin_account_wipe', 'approve', 'block', 'cancel_remote_wipe_then_activate', 'cancel_remote_wipe_then_block']: systemErrorExit(2, 'action must be one of wipe, wipeaccount, approve, block, cancel_remote_wipe_then_activate, cancel_remote_wipe_then_block; got %s' % body['action']) i += 2 - elif myarg == 'ifusers': - only_users = getUsersToModify(entity_type=sys.argv[i+1].lower(), entity=sys.argv[i+2]) + elif myarg in ['ifusers', 'matchusers']: + match_users = getUsersToModify(entity_type=sys.argv[i+1].lower(), entity=sys.argv[i+2]) i += 3 elif myarg == 'doit': doit = True @@ -9733,8 +9733,8 @@ def doUpdateMobile(): describe_as = 'Would perform' for device in devices: device_user = device.get('email', [''])[0] - if only_users and device_user not in only_users: - print('Skipping device for user %s that did not match if_users argument' % device_user) + if match_users and device_user not in match_users: + print('Skipping device for user %s that did not match match_users argument' % device_user) else: print('%s %s on user %s device %s' % (describe_as, body['action'], device_user, device['resourceId'])) if doit: