def getPrinterScopeListsForRole(cp, printerId, i, count, role):
try:
result = callGCP(cp.printers(), u'get',
throw_messages=[GCP.UNKNOWN_PRINTER],
printerid=printerId)
try:
jcount = len(result[u'printers'][0][u'access'])
except KeyError:
jcount = 0
scopeList = []
if jcount > 0:
for acl in result[u'printers'][0][u'access']:
if acl.get(u'role') == role:
scopeList.append(acl[u'scope'].lower())
return scopeList
except GCP.unknownPrinter as e:
entityActionFailedWarning([Ent.PRINTER, printerId], str(e), i, count)
return None
# gam printer|printers <PrinterIDEntity> sync user|manager|owner <PrinterACLScopeEntity> [notify]
评论列表
文章目录