mirror of
https://github.com/GAM-team/GAM.git
synced 2026-07-03 12:21:35 +00:00
Fixed bugs/cleaned output in gam info|print cros.
This commit is contained in:
@@ -2,6 +2,8 @@
|
|||||||
|
|
||||||
Added `chromeostype`, `diskspaceusage` and `faninfo` to `<CrOSFieldName>` for use in `gam info|print cros`.
|
Added `chromeostype`, `diskspaceusage` and `faninfo` to `<CrOSFieldName>` for use in `gam info|print cros`.
|
||||||
|
|
||||||
|
Fixed bugs/cleaned output in `gam info|print cros`.
|
||||||
|
|
||||||
7.07.15
|
7.07.15
|
||||||
|
|
||||||
Added option `shareddrivesoption included|included_if_account_is_not_a_member|not_included` to `gam create vaultexport`.
|
Added option `shareddrivesoption included|included_if_account_is_not_a_member|not_included` to `gam create vaultexport`.
|
||||||
|
|||||||
@@ -23822,6 +23822,7 @@ CROS_SCALAR_PROPERTY_PRINT_ORDER = [
|
|||||||
'notes',
|
'notes',
|
||||||
'serialNumber',
|
'serialNumber',
|
||||||
'status',
|
'status',
|
||||||
|
'chromeOsType',
|
||||||
'deviceLicenseType',
|
'deviceLicenseType',
|
||||||
'model',
|
'model',
|
||||||
'firmwareVersion',
|
'firmwareVersion',
|
||||||
@@ -23842,6 +23843,7 @@ CROS_SCALAR_PROPERTY_PRINT_ORDER = [
|
|||||||
'manufactureDate',
|
'manufactureDate',
|
||||||
'supportEndDate',
|
'supportEndDate',
|
||||||
'autoUpdateExpiration',
|
'autoUpdateExpiration',
|
||||||
|
'autoUpdateThrough',
|
||||||
'willAutoRenew',
|
'willAutoRenew',
|
||||||
]
|
]
|
||||||
|
|
||||||
@@ -23866,8 +23868,11 @@ CROS_TIME_OBJECTS = {
|
|||||||
'lastDeprovisionTimestamp',
|
'lastDeprovisionTimestamp',
|
||||||
'lastEnrollmentTime',
|
'lastEnrollmentTime',
|
||||||
'lastSync',
|
'lastSync',
|
||||||
|
'rebootTime',
|
||||||
'reportTime',
|
'reportTime',
|
||||||
'supportEndDate',
|
'supportEndDate',
|
||||||
|
'updateTime',
|
||||||
|
'updateCheckTime',
|
||||||
}
|
}
|
||||||
CROS_FIELDS_WITH_CRS_NLS = {'notes'}
|
CROS_FIELDS_WITH_CRS_NLS = {'notes'}
|
||||||
CROS_START_ARGUMENTS = ['start', 'startdate', 'oldestdate']
|
CROS_START_ARGUMENTS = ['start', 'startdate', 'oldestdate']
|
||||||
@@ -23984,13 +23989,13 @@ def infoCrOSDevices(entityList):
|
|||||||
printKeyValueWithCRsNLs(up, cros[up])
|
printKeyValueWithCRsNLs(up, cros[up])
|
||||||
else:
|
else:
|
||||||
printKeyValueList([up, formatLocalTime(cros[up])])
|
printKeyValueList([up, formatLocalTime(cros[up])])
|
||||||
up = 'tpmVersionInfo'
|
for up in ['diskSpaceUsage', 'osUpdateStatus', 'tpmVersionInfo']:
|
||||||
if up in cros:
|
if up in cros:
|
||||||
printKeyValueList([up, ''])
|
printKeyValueList([up, ''])
|
||||||
Ind.Increment()
|
Ind.Increment()
|
||||||
for key, value in sorted(iter(cros[up].items())):
|
for key, value in sorted(iter(cros[up].items())):
|
||||||
printKeyValueList([key, value])
|
printKeyValueList([key, value])
|
||||||
Ind.Decrement()
|
Ind.Decrement()
|
||||||
if not noLists:
|
if not noLists:
|
||||||
activeTimeRanges = _filterActiveTimeRanges(cros, True, listLimit, startDate, endDate, activeTimeRangesOrder)
|
activeTimeRanges = _filterActiveTimeRanges(cros, True, listLimit, startDate, endDate, activeTimeRangesOrder)
|
||||||
if activeTimeRanges:
|
if activeTimeRanges:
|
||||||
@@ -24044,6 +24049,9 @@ def infoCrOSDevices(entityList):
|
|||||||
entityActionNotPerformedWarning([Ent.CROS_DEVICE, deviceId, Ent.DEVICE_FILE, downloadfile],
|
entityActionNotPerformedWarning([Ent.CROS_DEVICE, deviceId, Ent.DEVICE_FILE, downloadfile],
|
||||||
Msg.NO_ENTITIES_FOUND.format(Ent.Plural(Ent.DEVICE_FILE)), i, count)
|
Msg.NO_ENTITIES_FOUND.format(Ent.Plural(Ent.DEVICE_FILE)), i, count)
|
||||||
Act.Set(Act.INFO)
|
Act.Set(Act.INFO)
|
||||||
|
cpuInfo = _filterBasicList(cros, 'cpuInfo', True, listLimit)
|
||||||
|
if cpuInfo:
|
||||||
|
showJSON('cpuInfo', cpuInfo, dictObjectsKey={'cpuInfo': 'model'})
|
||||||
cpuStatusReports = _filterCPUStatusReports(cros, True, listLimit, startTime, endTime)
|
cpuStatusReports = _filterCPUStatusReports(cros, True, listLimit, startTime, endTime)
|
||||||
if cpuStatusReports:
|
if cpuStatusReports:
|
||||||
printKeyValueList(['cpuStatusReports'])
|
printKeyValueList(['cpuStatusReports'])
|
||||||
@@ -24061,6 +24069,12 @@ def infoCrOSDevices(entityList):
|
|||||||
printKeyValueList(['cpuUtilizationPercentageInfo', cpuStatusReport['cpuUtilizationPercentageInfo']])
|
printKeyValueList(['cpuUtilizationPercentageInfo', cpuStatusReport['cpuUtilizationPercentageInfo']])
|
||||||
Ind.Decrement()
|
Ind.Decrement()
|
||||||
Ind.Decrement()
|
Ind.Decrement()
|
||||||
|
backlightInfo = _filterBasicList(cros, 'backLightInfo', True, listLimit)
|
||||||
|
if backlightInfo:
|
||||||
|
showJSON('backlightInfo', backlightInfo, dictObjectsKey={'backlightInfo': 'path'})
|
||||||
|
fanInfo = _filterBasicList(cros, 'fanInfo', True, listLimit)
|
||||||
|
if fanInfo:
|
||||||
|
showJSON('fanInfo', fanInfo)
|
||||||
diskVolumeReports = _filterBasicList(cros, 'diskVolumeReports', True, listLimit)
|
diskVolumeReports = _filterBasicList(cros, 'diskVolumeReports', True, listLimit)
|
||||||
if diskVolumeReports:
|
if diskVolumeReports:
|
||||||
printKeyValueList(['diskVolumeReports'])
|
printKeyValueList(['diskVolumeReports'])
|
||||||
@@ -24287,7 +24301,7 @@ CROS_ENTITIES_MAP = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
CROS_INDEXED_TITLES = ['activeTimeRanges', 'recentUsers', 'deviceFiles',
|
CROS_INDEXED_TITLES = ['activeTimeRanges', 'recentUsers', 'deviceFiles',
|
||||||
'cpuStatusReports', 'diskVolumeReports', 'lastKnownNetwork', 'screenshotFiles', 'systemRamFreeReports']
|
'cpuStatusReports', 'cpuInfo', 'backlightInfo', 'fanInfo', 'diskVolumeReports', 'lastKnownNetwork', 'screenshotFiles', 'systemRamFreeReports']
|
||||||
|
|
||||||
# gam print cros [todrive <ToDriveAttribute>*]
|
# gam print cros [todrive <ToDriveAttribute>*]
|
||||||
# [(query <QueryCrOS>)|(queries <QueryCrOSList>) [querytime<String> <Time>]
|
# [(query <QueryCrOS>)|(queries <QueryCrOSList>) [querytime<String> <Time>]
|
||||||
@@ -24334,12 +24348,15 @@ def doPrintCrOSDevices(entityList=None):
|
|||||||
if not noLists and not selectedLists:
|
if not noLists and not selectedLists:
|
||||||
csvPF.WriteRowTitles(flattenJSON(cros, listLimit=listLimit, timeObjects=CROS_TIME_OBJECTS))
|
csvPF.WriteRowTitles(flattenJSON(cros, listLimit=listLimit, timeObjects=CROS_TIME_OBJECTS))
|
||||||
return
|
return
|
||||||
attrib = 'tpmVersionInfo'
|
for attrib in ['diskSpaceUsage', 'osUpdateStatus', 'tpmVersionInfo']:
|
||||||
if attrib in cros:
|
if attrib in cros:
|
||||||
for key, value in sorted(iter(cros[attrib].items())):
|
for key, value in sorted(iter(cros[attrib].items())):
|
||||||
attribKey = f'{attrib}{GC.Values[GC.CSV_OUTPUT_SUBFIELD_DELIMITER]}{key}'
|
attribKey = f'{attrib}{GC.Values[GC.CSV_OUTPUT_SUBFIELD_DELIMITER]}{key}'
|
||||||
cros[attribKey] = value
|
if key not in CROS_TIME_OBJECTS:
|
||||||
cros.pop(attrib)
|
cros[attribKey] = value
|
||||||
|
else:
|
||||||
|
cros[attribKey] = formatLocalTime(value)
|
||||||
|
cros.pop(attrib)
|
||||||
activeTimeRanges = _filterActiveTimeRanges(cros, selectedLists.get('activeTimeRanges', False), listLimit, startDate, endDate, activeTimeRangesOrder)
|
activeTimeRanges = _filterActiveTimeRanges(cros, selectedLists.get('activeTimeRanges', False), listLimit, startDate, endDate, activeTimeRangesOrder)
|
||||||
recentUsers = _filterRecentUsers(cros, selectedLists.get('recentUsers', False), listLimit)
|
recentUsers = _filterRecentUsers(cros, selectedLists.get('recentUsers', False), listLimit)
|
||||||
deviceFiles = _filterDeviceFiles(cros, selectedLists.get('deviceFiles', False), listLimit, startTime, endTime)
|
deviceFiles = _filterDeviceFiles(cros, selectedLists.get('deviceFiles', False), listLimit, startTime, endTime)
|
||||||
@@ -24353,7 +24370,7 @@ def doPrintCrOSDevices(entityList=None):
|
|||||||
return
|
return
|
||||||
row = {}
|
row = {}
|
||||||
for attrib in cros:
|
for attrib in cros:
|
||||||
if attrib not in {'kind', 'etag', 'tpmVersionInfo', 'recentUsers', 'activeTimeRanges',
|
if attrib not in {'kind', 'etag', 'diskSpaceUsage', 'osUpdateStatus', 'tpmVersionInfo', 'activeTimeRanges', 'recentUsers',
|
||||||
'deviceFiles', 'cpuStatusReports', 'diskVolumeReports', 'lastKnownNetwork', 'screenshotFiles', 'systemRamFreeReports'}:
|
'deviceFiles', 'cpuStatusReports', 'diskVolumeReports', 'lastKnownNetwork', 'screenshotFiles', 'systemRamFreeReports'}:
|
||||||
if attrib not in CROS_TIME_OBJECTS:
|
if attrib not in CROS_TIME_OBJECTS:
|
||||||
row[attrib] = cros[attrib]
|
row[attrib] = cros[attrib]
|
||||||
@@ -24365,6 +24382,8 @@ def doPrintCrOSDevices(entityList=None):
|
|||||||
not cpuStatusReports and not diskVolumeReports and not lastKnownNetworks and not screenshotFiles and not systemRamFreeReports):
|
not cpuStatusReports and not diskVolumeReports and not lastKnownNetworks and not screenshotFiles and not systemRamFreeReports):
|
||||||
csvPF.WriteRowTitles(row)
|
csvPF.WriteRowTitles(row)
|
||||||
return
|
return
|
||||||
|
if 'cpuInfo' in cros:
|
||||||
|
flattenJSON({'cpuInfo': cros['cpuInfo']}, flattened=row)
|
||||||
lenATR = len(activeTimeRanges)
|
lenATR = len(activeTimeRanges)
|
||||||
lenRU = len(recentUsers)
|
lenRU = len(recentUsers)
|
||||||
lenDF = len(deviceFiles)
|
lenDF = len(deviceFiles)
|
||||||
|
|||||||
Reference in New Issue
Block a user