Merge branch 'main' of https://github.com/jay0lee/GAM into main

This commit is contained in:
Jay Lee
2021-04-02 08:11:05 -04:00
4 changed files with 14 additions and 5 deletions

View File

@@ -14,7 +14,7 @@ defaults:
env:
BUILD_PYTHON_VERSION: "3.9.2"
MIN_PYTHON_VERSION: "3.9.2"
BUILD_OPENSSL_VERSION: "1.1.1j"
BUILD_OPENSSL_VERSION: "1.1.1k"
MIN_OPENSSL_VERSION: "1.1.1i"
PATCHELF_VERSION: "0.12"
# PYINSTALLER_VERSION can be full commit hash or version like v4.20
@@ -108,7 +108,7 @@ jobs:
path: |
~/python
~/ssl
key: ${{ matrix.os }}-${{ matrix.jid }}-20210219
key: ${{ matrix.os }}-${{ matrix.jid }}-20210325
- name: Set env variables
env:

View File

@@ -76,6 +76,13 @@ def printshow_policies():
# 'chrome.devices.kiosk',
]
throw_reasons = [gapi_errors.ErrorReason.FOUR_O_O,]
orgunitPath = gapi_directory_orgunits.orgunit_from_orgunitid(orgunit[9:], None)
header = f'Organizational Unit: {orgunitPath}'
if printer_id:
header += f', printerid: {printer_id}'
elif app_id:
header += f', appid: {app_id}'
print(header)
for namespace in namespaces:
body['policySchemaFilter'] = f'{namespace}.*'
try:
@@ -87,6 +94,7 @@ def printshow_policies():
except googleapiclient.errors.HttpError:
policies = []
for policy in sorted(policies, key=lambda k: k.get('value', {}).get('policySchema', '')):
print()
name = policy.get('value', {}).get('policySchema', '')
print(name)
values = policy.get('value', {}).get('value', {})
@@ -94,7 +102,6 @@ def printshow_policies():
if isinstance(value, str) and value.find('_ENUM_') != -1:
value = value.split('_ENUM_')[-1]
print(f' {setting}: {value}')
print()
def build_schemas(svc=None, sfilter=None):

View File

@@ -402,7 +402,9 @@ def getOrgUnitId(orgUnit, cd=None):
return (orgUnit, result['orgUnitId'])
def orgunit_from_orgunitid(orgunitid, cd):
def orgunit_from_orgunitid(orgunitid, cd=None):
if cd is None:
cd = gapi_directory.build()
orgunitpath = GM_Globals[GM_MAP_ORGUNIT_ID_TO_NAME].get(orgunitid)
if not orgunitpath:
try:

View File

@@ -1,7 +1,7 @@
cryptography
distro; sys_platform == 'linux'
filelock
google-api-python-client>=1.7.10
google-api-python-client>=2.0.0
google-auth-httplib2
google-auth-oauthlib>=0.4.1
google-auth>=1.11.2