mirror of
https://github.com/GAM-team/GAM.git
synced 2025-05-12 12:17:20 +00:00
Updated code in gam delete|update chromepolicy
to handle the policyTargetKey[additionalTargetKeys]
field in a more general manner for future use.
This commit is contained in:
parent
742a6f14fe
commit
d2b7e339ff
@ -1,3 +1,8 @@
|
|||||||
|
7.06.05
|
||||||
|
|
||||||
|
Updated code in `gam delete|update chromepolicy` to handle the `policyTargetKey[additionalTargetKeys]`
|
||||||
|
field in a more general manner for future use.
|
||||||
|
|
||||||
7.06.04
|
7.06.04
|
||||||
|
|
||||||
Fixed bug in `gam report <ActivityApplictionName>` where a report with no activities
|
Fixed bug in `gam report <ActivityApplictionName>` where a report with no activities
|
||||||
|
@ -25,7 +25,7 @@ https://github.com/GAM-team/GAM/wiki
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
__author__ = 'GAM Team <google-apps-manager@googlegroups.com>'
|
__author__ = 'GAM Team <google-apps-manager@googlegroups.com>'
|
||||||
__version__ = '7.06.04'
|
__version__ = '7.06.05'
|
||||||
__license__ = 'Apache License 2.0 (http://www.apache.org/licenses/LICENSE-2.0)'
|
__license__ = 'Apache License 2.0 (http://www.apache.org/licenses/LICENSE-2.0)'
|
||||||
|
|
||||||
#pylint: disable=wrong-import-position
|
#pylint: disable=wrong-import-position
|
||||||
@ -28090,10 +28090,12 @@ def updatePolicyRequests(body, targetResource, printer_id, app_id):
|
|||||||
for request in body['requests']:
|
for request in body['requests']:
|
||||||
request.setdefault('policyTargetKey', {})
|
request.setdefault('policyTargetKey', {})
|
||||||
request['policyTargetKey']['targetResource'] = targetResource
|
request['policyTargetKey']['targetResource'] = targetResource
|
||||||
|
if app_id or printer_id:
|
||||||
|
request['policyTargetKey'].setdefault('additionalTargetKeys', {})
|
||||||
if app_id:
|
if app_id:
|
||||||
request['policyTargetKey']['additionalTargetKeys'] = {'app_id': app_id}
|
request['policyTargetKey']['additionalTargetKeys']['app_id'] = app_id
|
||||||
elif printer_id:
|
elif printer_id:
|
||||||
request['policyTargetKey']['additionalTargetKeys'] = {'printer_id': printer_id}
|
request['policyTargetKey']['additionalTargetKeys']['printer_id'] = printer_id
|
||||||
|
|
||||||
# gam delete chromepolicy
|
# gam delete chromepolicy
|
||||||
# (<SchemaName> [<JSONData>])+
|
# (<SchemaName> [<JSONData>])+
|
||||||
@ -28126,9 +28128,9 @@ def doDeleteChromePolicy():
|
|||||||
if checkArgumentPresent('json'):
|
if checkArgumentPresent('json'):
|
||||||
jsonData = getJSON(['direct', 'name', 'orgUnitPath', 'parentOrgUnitPath', 'group'])
|
jsonData = getJSON(['direct', 'name', 'orgUnitPath', 'parentOrgUnitPath', 'group'])
|
||||||
if 'additionalTargetKeys' in jsonData:
|
if 'additionalTargetKeys' in jsonData:
|
||||||
body['requests'][-1].setdefault('policyTargetKey', {})
|
body['requests'][-1].setdefault('policyTargetKey', {'additionalTargetKeys': {}})
|
||||||
for atk in jsonData['additionalTargetKeys']:
|
for atk in jsonData['additionalTargetKeys']:
|
||||||
body['requests'][-1]['policyTargetKey']['additionalTargetKeys'] = {atk['name']: atk['value']}
|
body['requests'][-1]['policyTargetKey']['additionalTargetKeys'][atk['name']] = atk['value']
|
||||||
checkPolicyArgs(targetResource, printer_id, app_id)
|
checkPolicyArgs(targetResource, printer_id, app_id)
|
||||||
count = len(body['requests'])
|
count = len(body['requests'])
|
||||||
if count != 1:
|
if count != 1:
|
||||||
@ -28281,9 +28283,9 @@ def doUpdateChromePolicy():
|
|||||||
jsonData = getJSON(['direct', 'name', 'orgUnitPath', 'parentOrgUnitPath', 'group'])
|
jsonData = getJSON(['direct', 'name', 'orgUnitPath', 'parentOrgUnitPath', 'group'])
|
||||||
schemaNameAppId = schemaName
|
schemaNameAppId = schemaName
|
||||||
if 'additionalTargetKeys' in jsonData:
|
if 'additionalTargetKeys' in jsonData:
|
||||||
body['requests'][-1].setdefault('policyTargetKey', {})
|
body['requests'][-1].setdefault('policyTargetKey', {'additionalTargetKeys': {}})
|
||||||
for atk in jsonData['additionalTargetKeys']:
|
for atk in jsonData['additionalTargetKeys']:
|
||||||
body['requests'][-1]['policyTargetKey']['additionalTargetKeys'] = {atk['name']: atk['value']}
|
body['requests'][-1]['policyTargetKey']['additionalTargetKeys'][atk['name']] = atk['value']
|
||||||
if atk['name'] == 'app_id':
|
if atk['name'] == 'app_id':
|
||||||
schemaNameAppId += f"({atk['value']})"
|
schemaNameAppId += f"({atk['value']})"
|
||||||
schemaNameList[-1] = schemaNameAppId
|
schemaNameList[-1] = schemaNameAppId
|
||||||
|
@ -10,6 +10,11 @@ Add the `-s` option to the end of the above commands to suppress creating the `g
|
|||||||
|
|
||||||
See [Downloads-Installs-GAM7](https://github.com/GAM-team/GAM/wiki/Downloads-Installs) for Windows or other options, including manual installation
|
See [Downloads-Installs-GAM7](https://github.com/GAM-team/GAM/wiki/Downloads-Installs) for Windows or other options, including manual installation
|
||||||
|
|
||||||
|
### 7.06.05
|
||||||
|
|
||||||
|
Updated code in `gam delete|update chromepolicy` to handle the `policyTargetKey[additionalTargetKeys]`
|
||||||
|
field in a more general manner for future use.
|
||||||
|
|
||||||
### 7.06.04
|
### 7.06.04
|
||||||
|
|
||||||
Fixed bug in `gam report <ActivityApplictionName>` where a report with no activities
|
Fixed bug in `gam report <ActivityApplictionName>` where a report with no activities
|
||||||
|
@ -251,10 +251,10 @@ writes the credentials into the file oauth2.txt.
|
|||||||
admin@server:/Users/admin$ rm -f /Users/admin/GAMConfig/oauth2.txt
|
admin@server:/Users/admin$ rm -f /Users/admin/GAMConfig/oauth2.txt
|
||||||
admin@server:/Users/admin$ gam version
|
admin@server:/Users/admin$ gam version
|
||||||
WARNING: Config File: /Users/admin/GAMConfig/gam.cfg, Section: DEFAULT, Item: oauth2_txt, Value: /Users/admin/GAMConfig/oauth2.txt, Not Found
|
WARNING: Config File: /Users/admin/GAMConfig/gam.cfg, Section: DEFAULT, Item: oauth2_txt, Value: /Users/admin/GAMConfig/oauth2.txt, Not Found
|
||||||
GAM 7.06.04 - https://github.com/GAM-team/GAM - pyinstaller
|
GAM 7.06.05 - https://github.com/GAM-team/GAM - pyinstaller
|
||||||
GAM Team <google-apps-manager@googlegroups.com>
|
GAM Team <google-apps-manager@googlegroups.com>
|
||||||
Python 3.13.3 64-bit final
|
Python 3.13.3 64-bit final
|
||||||
MacOS Sequoia 15.4 x86_64
|
MacOS Sequoia 15.4.1 x86_64
|
||||||
Path: /Users/admin/bin/gam7
|
Path: /Users/admin/bin/gam7
|
||||||
Config File: /Users/admin/GAMConfig/gam.cfg, Section: DEFAULT, customer_id: my_customer, domain: domain.com
|
Config File: /Users/admin/GAMConfig/gam.cfg, Section: DEFAULT, customer_id: my_customer, domain: domain.com
|
||||||
|
|
||||||
@ -989,7 +989,7 @@ writes the credentials into the file oauth2.txt.
|
|||||||
C:\>del C:\GAMConfig\oauth2.txt
|
C:\>del C:\GAMConfig\oauth2.txt
|
||||||
C:\>gam version
|
C:\>gam version
|
||||||
WARNING: Config File: C:\GAMConfig\gam.cfg, Section: DEFAULT, Item: oauth2_txt, Value: C:\GAMConfig\oauth2.txt, Not Found
|
WARNING: Config File: C:\GAMConfig\gam.cfg, Section: DEFAULT, Item: oauth2_txt, Value: C:\GAMConfig\oauth2.txt, Not Found
|
||||||
GAM 7.06.04 - https://github.com/GAM-team/GAM - pythonsource
|
GAM 7.06.05 - https://github.com/GAM-team/GAM - pythonsource
|
||||||
GAM Team <google-apps-manager@googlegroups.com>
|
GAM Team <google-apps-manager@googlegroups.com>
|
||||||
Python 3.13.3 64-bit final
|
Python 3.13.3 64-bit final
|
||||||
Windows-10-10.0.17134 AMD64
|
Windows-10-10.0.17134 AMD64
|
||||||
|
@ -4,10 +4,10 @@ k
|
|||||||
Print the current version of Gam with details
|
Print the current version of Gam with details
|
||||||
```
|
```
|
||||||
gam version
|
gam version
|
||||||
GAM 7.06.04 - https://github.com/GAM-team/GAM - pyinstaller
|
GAM 7.06.05 - https://github.com/GAM-team/GAM - pyinstaller
|
||||||
GAM Team <google-apps-manager@googlegroups.com>
|
GAM Team <google-apps-manager@googlegroups.com>
|
||||||
Python 3.13.3 64-bit final
|
Python 3.13.3 64-bit final
|
||||||
MacOS Sequoia 15.4 x86_64
|
MacOS Sequoia 15.4.1 x86_64
|
||||||
Path: /Users/Admin/bin/gam7
|
Path: /Users/Admin/bin/gam7
|
||||||
Config File: /Users/admin/GAMConfig/gam.cfg, Section: DEFAULT, customer_id: my_customer, domain: domain.com
|
Config File: /Users/admin/GAMConfig/gam.cfg, Section: DEFAULT, customer_id: my_customer, domain: domain.com
|
||||||
Time: 2023-06-02T21:10:00-07:00
|
Time: 2023-06-02T21:10:00-07:00
|
||||||
@ -16,10 +16,10 @@ Time: 2023-06-02T21:10:00-07:00
|
|||||||
Print the current version of Gam with details and time offset information
|
Print the current version of Gam with details and time offset information
|
||||||
```
|
```
|
||||||
gam version timeoffset
|
gam version timeoffset
|
||||||
GAM 7.06.04 - https://github.com/GAM-team/GAM - pyinstaller
|
GAM 7.06.05 - https://github.com/GAM-team/GAM - pyinstaller
|
||||||
GAM Team <google-apps-manager@googlegroups.com>
|
GAM Team <google-apps-manager@googlegroups.com>
|
||||||
Python 3.13.3 64-bit final
|
Python 3.13.3 64-bit final
|
||||||
MacOS Sequoia 15.4 x86_64
|
MacOS Sequoia 15.4.1 x86_64
|
||||||
Path: /Users/Admin/bin/gam7
|
Path: /Users/Admin/bin/gam7
|
||||||
Config File: /Users/admin/GAMConfig/gam.cfg, Section: DEFAULT, customer_id: my_customer, domain: domain.com
|
Config File: /Users/admin/GAMConfig/gam.cfg, Section: DEFAULT, customer_id: my_customer, domain: domain.com
|
||||||
Your system time differs from www.googleapis.com by less than 1 second
|
Your system time differs from www.googleapis.com by less than 1 second
|
||||||
@ -28,10 +28,10 @@ Your system time differs from www.googleapis.com by less than 1 second
|
|||||||
Print the current version of Gam with extended details and SSL information
|
Print the current version of Gam with extended details and SSL information
|
||||||
```
|
```
|
||||||
gam version extended
|
gam version extended
|
||||||
GAM 7.06.04 - https://github.com/GAM-team/GAM - pyinstaller
|
GAM 7.06.05 - https://github.com/GAM-team/GAM - pyinstaller
|
||||||
GAM Team <google-apps-manager@googlegroups.com>
|
GAM Team <google-apps-manager@googlegroups.com>
|
||||||
Python 3.13.3 64-bit final
|
Python 3.13.3 64-bit final
|
||||||
MacOS Sequoia 15.4 x86_64
|
MacOS Sequoia 15.4.1 x86_64
|
||||||
Path: /Users/Admin/bin/gam7
|
Path: /Users/Admin/bin/gam7
|
||||||
Config File: /Users/admin/GAMConfig/gam.cfg, Section: DEFAULT, customer_id: my_customer, domain: domain.com
|
Config File: /Users/admin/GAMConfig/gam.cfg, Section: DEFAULT, customer_id: my_customer, domain: domain.com
|
||||||
Time: 2023-06-02T21:10:00-07:00
|
Time: 2023-06-02T21:10:00-07:00
|
||||||
@ -65,7 +65,7 @@ MacOS High Sierra 10.13.6 x86_64
|
|||||||
Path: /Users/Admin/bin/gam7
|
Path: /Users/Admin/bin/gam7
|
||||||
Version Check:
|
Version Check:
|
||||||
Current: 5.35.08
|
Current: 5.35.08
|
||||||
Latest: 7.06.04
|
Latest: 7.06.05
|
||||||
echo $?
|
echo $?
|
||||||
1
|
1
|
||||||
```
|
```
|
||||||
@ -73,7 +73,7 @@ echo $?
|
|||||||
Print the current version number without details
|
Print the current version number without details
|
||||||
```
|
```
|
||||||
gam version simple
|
gam version simple
|
||||||
7.06.04
|
7.06.05
|
||||||
```
|
```
|
||||||
In Linux/MacOS you can do:
|
In Linux/MacOS you can do:
|
||||||
```
|
```
|
||||||
@ -83,10 +83,10 @@ echo $VER
|
|||||||
Print the current version of Gam and address of this Wiki
|
Print the current version of Gam and address of this Wiki
|
||||||
```
|
```
|
||||||
gam help
|
gam help
|
||||||
GAM 7.06.04 - https://github.com/GAM-team/GAM
|
GAM 7.06.05 - https://github.com/GAM-team/GAM
|
||||||
GAM Team <google-apps-manager@googlegroups.com>
|
GAM Team <google-apps-manager@googlegroups.com>
|
||||||
Python 3.13.3 64-bit final
|
Python 3.13.3 64-bit final
|
||||||
MacOS Sequoia 15.4 x86_64
|
MacOS Sequoia 15.4.1 x86_64
|
||||||
Path: /Users/Admin/bin/gam7
|
Path: /Users/Admin/bin/gam7
|
||||||
Config File: /Users/admin/GAMConfig/gam.cfg, Section: DEFAULT, customer_id: my_customer, domain: domain.com
|
Config File: /Users/admin/GAMConfig/gam.cfg, Section: DEFAULT, customer_id: my_customer, domain: domain.com
|
||||||
Time: 2023-06-02T21:10:00-07:00
|
Time: 2023-06-02T21:10:00-07:00
|
||||||
|
Loading…
x
Reference in New Issue
Block a user