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>] [fields <BrowserFieldNameList>]
gam print browsers [todrive] gam print browsers [todrive]
[query <QueryBrowser>] [ou|org|orgunit <OrgUnitPath>] [query <QueryBrowser>]
[projection basic|full] [projection basic|full]
[fields <BrowserFieldNameList>] [fields <BrowserFieldNameList>]
[sortheaders] [sortheaders]

View File

@@ -121,7 +121,7 @@ def move():
def print_(): def print_():
cbcm = build() cbcm = build()
projection = 'BASIC' projection = 'BASIC'
query = None orgUnitPath = query = None
fields = None fields = None
titles = [] titles = []
csv_rows = [] csv_rows = []
@@ -133,6 +133,9 @@ def print_():
if myarg == 'query': if myarg == 'query':
query = sys.argv[i+1] query = sys.argv[i+1]
i += 2 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': elif myarg == 'projection':
projection = sys.argv[i + 1].upper() projection = sys.argv[i + 1].upper()
i += 2 i += 2
@@ -155,7 +158,7 @@ def print_():
browsers = gapi.get_all_pages(cbcm.chromebrowsers(), 'list', browsers = gapi.get_all_pages(cbcm.chromebrowsers(), 'list',
'browsers', page_message=page_message, 'browsers', page_message=page_message,
customer=GC_Values[GC_CUSTOMER_ID], customer=GC_Values[GC_CUSTOMER_ID],
query=query, projection=projection, orgUnitPath=orgUnitPath, query=query, projection=projection,
fields=fields) fields=fields)
for browser in browsers: for browser in browsers:
browser = utils.flatten_json(browser) browser = utils.flatten_json(browser)