-
Notifications
You must be signed in to change notification settings - Fork 88
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updated
gam print|show chromeversions
to avoid a trap where a versi…
…on was returned without a `version` field.
- Loading branch information
Showing
2 changed files
with
11 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,7 +23,7 @@ | |
""" | ||
|
||
__author__ = 'Ross Scroggs <[email protected]>' | ||
__version__ = '6.01.00' | ||
__version__ = '6.01.01' | ||
__license__ = 'Apache License 2.0 (http://www.apache.org/licenses/LICENSE-2.0)' | ||
|
||
import base64 | ||
|
@@ -20009,6 +20009,8 @@ def doPrintShowChromeVersions(): | |
def _printVersion(version): | ||
if showOrgUnit: | ||
version['orgUnitPath'] = orgUnitPath | ||
if 'version' not in version: | ||
version['version'] = 'Unknown' | ||
if FJQC.formatJSON: | ||
if (not csvPF.rowFilter and not csvPF.rowDropFilter) or csvPF.CheckRowTitles(flattenJSON(version)): | ||
csvPF.WriteRowNoFilter({'version': version['version'], 'count': version['count'], | ||
|
@@ -20020,6 +20022,8 @@ def _printVersion(version): | |
def _showVersion(version, i=0, count=0): | ||
if showOrgUnit: | ||
version['orgUnitPath'] = orgUnitPath | ||
if 'version' not in version: | ||
version['version'] = 'Unknown' | ||
if FJQC is not None and FJQC.formatJSON: | ||
printLine(json.dumps(cleanJSON(version), ensure_ascii=False, sort_keys=True)) | ||
else: | ||
|
@@ -20108,12 +20112,12 @@ def _showVersion(version, i=0, count=0): | |
entityPerformActionNumItems([Ent.ORGANIZATIONAL_UNIT, orgUnitPath], jcount, Ent.CHROME_VERSION) | ||
Ind.Increment() | ||
j = 0 | ||
for version in sorted(versions, key=lambda k: k['version'], reverse=reverse): | ||
for version in sorted(versions, key=lambda k: k.get('version', 'Unknown'), reverse=reverse): | ||
j += 1 | ||
_showVersion(version, j, jcount) | ||
Ind.Decrement() | ||
else: | ||
for version in sorted(versions, key=lambda k: k['version'], reverse=reverse): | ||
for version in sorted(versions, key=lambda k: k.get('version', 'Unknown'), reverse=reverse): | ||
_printVersion(version) | ||
if csvPF: | ||
csvPF.writeCSVfile('Chrome Versions') | ||
|