Add ou <OrgUnitPath> to print browsers (#1324)

This commit is contained in:
Ross Scroggs
2021-02-15 18:58:08 -08:00
committed by GitHub
parent 8fc9e6d1ee
commit 45a3c89b0b
2 changed files with 6 additions and 3 deletions

View File

@@ -1127,7 +1127,7 @@ gam info browser <DeviceID>
[fields <BrowserFieldNameList>]
gam print browsers [todrive]
[query <QueryBrowser>]
[ou|org|orgunit <OrgUnitPath>] [query <QueryBrowser>]
[projection basic|full]
[fields <BrowserFieldNameList>]
[sortheaders]

View File

@@ -121,7 +121,7 @@ def move():
def print_():
cbcm = build()
projection = 'BASIC'
query = None
orgUnitPath = query = None
fields = None
titles = []
csv_rows = []
@@ -133,6 +133,9 @@ def print_():
if myarg == 'query':
query = sys.argv[i+1]
i += 2
elif myarg in ['ou', 'org', 'orgunit']:
orgUnitPath = gapi_directory_orgunits.getOrgUnitItem(sys.argv[i + 1], pathOnly=True, absolutePath=True)
i += 2
elif myarg == 'projection':
projection = sys.argv[i + 1].upper()
i += 2
@@ -155,7 +158,7 @@ def print_():
browsers = gapi.get_all_pages(cbcm.chromebrowsers(), 'list',
'browsers', page_message=page_message,
customer=GC_Values[GC_CUSTOMER_ID],
query=query, projection=projection,
orgUnitPath=orgUnitPath, query=query, projection=projection,
fields=fields)
for browser in browsers:
browser = utils.flatten_json(browser)