Update policies and user invitations (#1339)

* Update policies and user invitations

Show chrome policy schemas in sorted order

Change create userintervention to send userintervention  to be consistent with API
Add state and orderby option to print userinvitations

* Sort polices in show chromepolicies
This commit is contained in:
Ross Scroggs
2021-03-22 06:06:04 -07:00
committed by GitHub
parent 90160da042
commit b333816dc8
4 changed files with 67 additions and 13 deletions

View File

@ -86,7 +86,7 @@ def printshow_policies():
body=body)
except googleapiclient.errors.HttpError:
policies = []
for policy in policies:
for policy in sorted(policies, key=lambda k: k.get('value', {}).get('policySchema', '')):
name = policy.get('value', {}).get('policySchema', '')
print(name)
values = policy.get('value', {}).get('value', {})
@ -169,7 +169,7 @@ def printshow_schemas():
msg = f'{myarg} is not a valid argument to "gam print chromeschema"'
controlflow.system_error_exit(3, msg)
schemas = build_schemas(svc, sfilter)
for value in schemas.values():
for _, value in sorted(iter(schemas.items())):
print(f'{value.get("name")}: {value.get("description")}')
for val in value['settings'].values():
vtype = val.get('type')