mirror of
https://github.com/GAM-team/GAM.git
synced 2026-06-28 01:41:36 +00:00
Make gam info crostelemetry <SerialNumber> (#1464)
* Make gam info crostelemetry <SerialNumber> * Handle missing <SerialNumber> for gam info crostelemetry
This commit is contained in:
@@ -203,7 +203,7 @@ def printAppDevices():
|
||||
display.write_csv_file(csvRows, titles, 'Chrome Installed Application Devices', todrive)
|
||||
|
||||
|
||||
def printShowCrosTelemetry(show=False):
|
||||
def printShowCrosTelemetry(mode):
|
||||
cm = build()
|
||||
cd = None
|
||||
parent = _get_customerid()
|
||||
@@ -217,6 +217,12 @@ def printShowCrosTelemetry(show=False):
|
||||
supported_readmask_values.sort()
|
||||
supported_readmask_map = {item.lower():item for item in supported_readmask_values}
|
||||
i = 3
|
||||
if mode == 'info':
|
||||
if i >= len(sys.argv):
|
||||
controlflow.system_error_exit(3, f'<SerialNumber> required for "gam info crostelemetry"')
|
||||
filter_ = f'serialNumber={sys.argv[i]}'
|
||||
i += 1
|
||||
mode = 'show'
|
||||
while i < len(sys.argv):
|
||||
myarg = sys.argv[i].lower().replace('_', '')
|
||||
if myarg == 'fields':
|
||||
@@ -286,7 +292,7 @@ def printShowCrosTelemetry(show=False):
|
||||
if orgUnitId not in orgUnitIdPathMap:
|
||||
orgUnitIdPathMap[orgUnitId] = gapi_directory_orgunits.orgunit_from_orgunitid(orgUnitId, cd)
|
||||
device['orgUnitPath'] = orgUnitIdPathMap[orgUnitId]
|
||||
if show:
|
||||
if mode == 'show':
|
||||
for device in devices:
|
||||
display.print_json(device)
|
||||
print()
|
||||
|
||||
Reference in New Issue
Block a user