I suggest match_users instead of if_users (#980)

* I suggest match_users instead of if_users

* Allow if_users or match_users
This commit is contained in:
Ross Scroggs
2019-07-26 06:06:45 -07:00
committed by Jay Lee
parent 1f88c18f94
commit 67cd03d3f1
2 changed files with 6 additions and 6 deletions

View File

@@ -1050,7 +1050,7 @@ The listlimit <Number> argument limits the number of recent users, time ranges a
The start <Date> and end <Date> arguments filter the time ranges.
Delimiter defaults to comma.
gam update mobile <MobileID> action <MobileAction>
gam update mobile <MobileID>|query:<QueryMobile> action <MobileAction> [doit] [if_users|match_users <UserTypeEntity>]
gam delete mobile <MobileID>
gam info mobile <MobileID>
gam print mobile [todrive] [(query <QueryMobile>)|(queries <QueryMobileList>)] [basic|full] [orderby <MobileOrderByFieldName> [ascending|descending]]

View File

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