mirror of
https://github.com/GAM-team/GAM.git
synced 2026-06-29 18:31:38 +00:00
More bug/pylint cleanup (#1258)
* More bug/pylint cleanup * pylint cleanup groups.py * Update GamCommands.txt
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
import sys
|
||||
|
||||
from gam.var import *
|
||||
from gam import controlflow
|
||||
from gam import gapi
|
||||
from gam.gapi import directory as gapi_directory
|
||||
from gam import utils
|
||||
|
||||
@@ -221,11 +221,11 @@ def info_member():
|
||||
cd = gapi_directory.build()
|
||||
memberKey = gam.normalizeEmailAddressOrUID(sys.argv[3])
|
||||
groupKey = gam.normalizeEmailAddressOrUID(sys.argv[4])
|
||||
info = gapi.call(cd.members(),
|
||||
'get',
|
||||
memberKey=memberKey,
|
||||
groupKey=groupKey)
|
||||
display.print_json(info)
|
||||
member_info = gapi.call(cd.members(),
|
||||
'get',
|
||||
memberKey=memberKey,
|
||||
groupKey=groupKey)
|
||||
display.print_json(member_info)
|
||||
|
||||
|
||||
GROUP_ARGUMENT_TO_PROPERTY_TITLE_MAP = {
|
||||
@@ -1146,7 +1146,7 @@ def update():
|
||||
i += 2
|
||||
elif myarg == 'admincreated':
|
||||
use_cd_api = True
|
||||
cd_body['adminCreated'] = getBoolean(sys.argv[i + 1], myarg)
|
||||
cd_body['adminCreated'] = gam.getBoolean(sys.argv[i + 1], myarg)
|
||||
i += 2
|
||||
elif myarg == 'getbeforeupdate':
|
||||
gs_get_before_update = True
|
||||
@@ -1242,5 +1242,3 @@ def getGroupAttrValue(myarg, value, gs_object, gs_body, function):
|
||||
gs_body[attrib] = value
|
||||
return
|
||||
controlflow.invalid_argument_exit(myarg, f'gam {function} group')
|
||||
|
||||
|
||||
|
||||
@@ -23,16 +23,16 @@ def delete():
|
||||
def info():
|
||||
cd = gapi_directory.build()
|
||||
resourceId = sys.argv[3]
|
||||
info = gapi.call(cd.mobiledevices(),
|
||||
'get',
|
||||
customerId=GC_Values[GC_CUSTOMER_ID],
|
||||
resourceId=resourceId)
|
||||
device_info = gapi.call(cd.mobiledevices(),
|
||||
'get',
|
||||
customerId=GC_Values[GC_CUSTOMER_ID],
|
||||
resourceId=resourceId)
|
||||
if 'deviceId' in info:
|
||||
info['deviceId'] = info['deviceId'].encode('unicode-escape').decode(
|
||||
device_info['deviceId'] = device_info['deviceId'].encode('unicode-escape').decode(
|
||||
UTF8)
|
||||
attrib = 'securityPatchLevel'
|
||||
if attrib in info and int(info[attrib]):
|
||||
info[attrib] = utils.formatTimestampYMDHMS(info[attrib])
|
||||
if attrib in info and int(device_info[attrib]):
|
||||
device_info[attrib] = utils.formatTimestampYMDHMS(device_info[attrib])
|
||||
display.print_json(info)
|
||||
|
||||
|
||||
@@ -161,7 +161,7 @@ def print_():
|
||||
|
||||
|
||||
def update():
|
||||
cd = gapi_directory.build
|
||||
cd = gapi_directory.build()
|
||||
resourceIds = sys.argv[3]
|
||||
match_users = None
|
||||
doit = False
|
||||
@@ -235,5 +235,3 @@ def update():
|
||||
resourceId=device['resourceId'],
|
||||
body=body,
|
||||
customerId=GC_Values[GC_CUSTOMER_ID])
|
||||
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ def flatten_privilege_list(privs, parent=None):
|
||||
parent=priv['privilegeName'])
|
||||
priv['children'] = ' '.join(
|
||||
[child['privilegeName'] for child in children])
|
||||
del (priv['childPrivileges'])
|
||||
del priv['childPrivileges']
|
||||
flat_privs = flat_privs + children
|
||||
flat_privs.append(priv)
|
||||
return flat_privs
|
||||
|
||||
@@ -28,5 +28,3 @@ def turn_off_2sv(users):
|
||||
'turnOff',
|
||||
soft_errors=True,
|
||||
userKey=user)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user