Fix chrome policy bugs
Some checks failed
Build and test GAM / build (Win64, build, 10, VC-WIN64A, windows-2022) (push) Has been cancelled
Build and test GAM / build (aarch64, build, 3, linux-aarch64, ubuntu-24.04-arm) (push) Has been cancelled
Build and test GAM / build (aarch64, build, 4, linux-aarch64, ubuntu-22.04-arm) (push) Has been cancelled
Build and test GAM / build (aarch64, build, 6, linux-aarch64, ubuntu-22.04-arm, yes) (push) Has been cancelled
Build and test GAM / build (aarch64, build, 8, darwin64-arm64, macos-14) (push) Has been cancelled
Build and test GAM / build (aarch64, build, 9, darwin64-arm64, macos-15) (push) Has been cancelled
Build and test GAM / build (x86_64, build, 1, linux-x86_64, ubuntu-22.04) (push) Has been cancelled
Build and test GAM / build (x86_64, build, 2, linux-x86_64, ubuntu-24.04) (push) Has been cancelled
Build and test GAM / build (x86_64, build, 5, linux-x86_64, ubuntu-22.04, yes) (push) Has been cancelled
Build and test GAM / build (x86_64, build, 7, darwin64-x86_64, macos-13) (push) Has been cancelled
Build and test GAM / build (x86_64, test, 11, ubuntu-24.04, 3.10) (push) Has been cancelled
Build and test GAM / build (x86_64, test, 12, ubuntu-24.04, 3.11) (push) Has been cancelled
Build and test GAM / build (x86_64, test, 13, ubuntu-24.04, 3.12) (push) Has been cancelled
CodeQL / Analyze (python) (push) Has been cancelled
Check for Google Root CA Updates / check-apis (push) Has been cancelled
Build and test GAM / merge (push) Has been cancelled
Build and test GAM / publish (push) Has been cancelled

This commit is contained in:
Ross Scroggs 2025-04-03 17:10:05 -07:00
parent c81121df58
commit 0a3e00df80
No known key found for this signature in database
GPG Key ID: 54585EA0887857D5
2 changed files with 13 additions and 3 deletions

View File

@ -1,3 +1,13 @@
7.05.21
Fixed bug in `gam update chromepolicy` that generated an error like the following
when JSON data was read from a file.
```
ERROR: JSON: {'error': {'code': 400, 'message': 'Invalid enum value: {prefix}{value} for enum type: chrome.policy.api.v1.devicepolicy.AllowNewUsersEnum', 'status': 'INVALID_ARGUMENT'}}
```
Fixed bug in `gam create chromepolicyimage` that caused a trap.
7.05.20
Updated code to validate both `<RegularExpression>` and `<ReplacementString>`

View File

@ -25,7 +25,7 @@ https://github.com/GAM-team/GAM/wiki
"""
__author__ = 'GAM Team <google-apps-manager@googlegroups.com>'
__version__ = '7.05.20'
__version__ = '7.05.21'
__license__ = 'Apache License 2.0 (http://www.apache.org/licenses/LICENSE-2.0)'
#pylint: disable=wrong-import-position
@ -28290,7 +28290,7 @@ def doUpdateChromePolicy():
elif vtype == 'TYPE_ENUM':
prefix = schema['settings'][lowerField]['enum_prefix']
if not value.startswith(prefix):
value = "{prefix}{value}"
value = f"{prefix}{value}"
elif vtype == 'TYPE_LIST':
value = value.split(',') if value else []
if myarg == 'chrome.users.chromebrowserupdates' and casedField == 'targetVersionPrefixSetting':
@ -28656,7 +28656,7 @@ def doCreateChromePolicyImage():
cp = buildGAPIObject(API.CHROMEPOLICY)
parent = _getCustomersCustomerIdWithC()
schema = getChoice(CHROME_IMAGE_SCHEMAS_MAP, mapChoice=True)
parameters = {}
parameters = {DFA_URL: None}
parameters[DFA_LOCALFILEPATH] = os.path.expanduser(getString(Cmd.OB_FILE_NAME))
try:
f = open(parameters[DFA_LOCALFILEPATH], 'rb')