When displaying printers, add orgUnitPath (#1338)

This commit is contained in:
Ross Scroggs
2021-03-19 11:19:40 -07:00
committed by GitHub
parent 6f2ebf8d2d
commit 90160da042
4 changed files with 23 additions and 21 deletions

View File

@@ -89,10 +89,13 @@ def info():
customer = _get_customerid()
printer_id = sys.argv[3]
name = f'{customer}/chrome/printers/{printer_id}'
result = gapi.call(cdapi.customers().chrome().printers(),
printer = gapi.call(cdapi.customers().chrome().printers(),
'get',
name=name)
display.print_json(result)
if 'orgUnitId' in printer:
printer['orgUnitPath'] = gapi_directory_orgunits.orgunit_from_orgunitid(
printer['orgUnitId'], cdapi)
display.print_json(printer)
def print_():
@@ -120,6 +123,9 @@ def print_():
parent=parent,
filter=filter_)
for printer in printers:
if 'orgUnitId' in printer:
printer['orgUnitPath'] = gapi_directory_orgunits.orgunit_from_orgunitid(
printer['orgUnitId'], cdapi)
row = {}
for key, val in printer.items():
if key not in titles: