Revisión 323
Añadido por Manu Mora Gordillo hace alrededor de 13 años
scripts/nfs/puppetlastgroups | ||
---|---|---|
tmp=sorted(data, key=itemgetter(0))
|
||
return tmp
|
||
|
||
def formatListLTSP(search):
|
||
from operator import itemgetter, attrgetter
|
||
data=[]
|
||
tmp=[]
|
||
servers=search[0][0][1]['nisNetgroupTriple']
|
||
for s in servers:
|
||
tmp.append(s.replace("(","").replace(",-,-)",""))
|
||
|
||
tuple = ("LTSP-Servers",tmp)
|
||
data.append(tuple)
|
||
tmp=sorted(data, key=itemgetter(1))
|
||
return tmp
|
||
|
||
|
||
# Rutina principal
|
||
def puppetlast(times,search):
|
||
import pdb
|
||
... | ... | |
times_temp.append (t)
|
||
|
||
if len(times_temp)>1:
|
||
print "\n- "+curso+" ("+str(len(alumnos))+" alumnos) ("+str(len(times_temp))+" certificados)"
|
||
print "\n- "+curso+" ("+str(len(alumnos))+" elementos) ("+str(len(times_temp))+" certificados)"
|
||
printtimes(times_temp)
|
||
|
||
|
||
... | ... | |
|
||
grupo=""
|
||
if len (sys.argv)==2:
|
||
grupo=sys.argv[1]
|
||
filter="(&(groupType=school_class)(cn="+grupo+"))"
|
||
grupo=sys.argv[1]
|
||
filter="(&(groupType=school_class)(cn="+grupo+"))"
|
||
else:
|
||
filter="(&(groupType=school_class))"
|
||
filter="(&(groupType=school_class))"
|
||
|
||
search = ldapSearch("ou=Group",filter,["memberUid"])
|
||
|
||
... | ... | |
t=gettimes(data)
|
||
puppetlast(t,data)
|
||
|
||
|
||
if grupo=="":
|
||
search = ldapSearch("cn=ltsp-server-hosts, ou=Netgroup","cn=*",["nisNetgroupTriple"])
|
||
data = formatListLTSP(search)
|
||
t=gettimes(data)
|
||
puppetlast(t,data)
|
Exportar a: Unified diff
Añado grupo LTSP-Servers