[Mac_prise] Corrections
This commit is contained in:
parent
a95b3a1b9d
commit
74dfca0736
2 changed files with 19 additions and 12 deletions
|
@ -77,9 +77,12 @@ def genere_comptage(duree, groupe, associes):
|
|||
# On retire les machines associées à l'adhérent possédant la chambre
|
||||
if groupe == 'chambre':
|
||||
for i in liste_associes:
|
||||
proprio_associe = ldap.search('macAddress=%s' % i)[0].proprio()
|
||||
if str(proprio_associe['chbre']).lower() == entry[groupe]:
|
||||
liste_associes.remove(i)
|
||||
try:
|
||||
proprio_associe = ldap.search('macAddress=%s' % i)[0].proprio()
|
||||
if str(proprio_associe['chbre']).lower() == entry[groupe]:
|
||||
liste_associes.remove(i)
|
||||
except:
|
||||
pass
|
||||
if len(liste_associes) < mac_prise.tres_suspect[duree][groupe]:
|
||||
continue
|
||||
|
||||
|
@ -118,11 +121,13 @@ def genere_comptage(duree, groupe, associes):
|
|||
largeurs = (longueur[groupe][0], longueur_max)
|
||||
|
||||
data = []
|
||||
for clef, valeurs in pb_comptage_suspect.items():
|
||||
data.append([clef, ", ".join(valeurs)])
|
||||
clefs = pb_comptage_suspect.keys()
|
||||
clefs.sort()
|
||||
for clef in clefs:
|
||||
data.append([clef, ", ".join(pb_comptage_suspect[clef])])
|
||||
|
||||
output += tableau(data, titres[groupe], largeurs, alignements)
|
||||
output += "\n\n\n"
|
||||
output += u"\n\n\n"
|
||||
|
||||
if len(pb_comptage_tres_suspect) > 0:
|
||||
output += mac_prise.titre_tres_suspect[duree][groupe]+"\n"
|
||||
|
@ -131,11 +136,13 @@ def genere_comptage(duree, groupe, associes):
|
|||
largeurs = (longueur[groupe][0], longueur_max)
|
||||
|
||||
data = []
|
||||
for clef, valeurs in pb_comptage_tres_suspect.items():
|
||||
data.append([clef, ", ".join(valeurs)])
|
||||
clefs = pb_comptage_tres_suspect.keys()
|
||||
clefs.sort()
|
||||
for clef in clefs:
|
||||
data.append([clef, ", ".join(pb_comptage_tres_suspect[clef])])
|
||||
|
||||
output += tableau(data, titres[groupe], largeurs, alignements)
|
||||
output += "\n\n\n"
|
||||
output += u"\n\n\n"
|
||||
|
||||
return output
|
||||
|
||||
|
@ -153,4 +160,4 @@ if __name__ == '__main__':
|
|||
if len(output) == coupure:
|
||||
sys.exit(0)
|
||||
|
||||
print output
|
||||
print output.encode('utf-8')
|
||||
|
|
|
@ -10,8 +10,8 @@ SWITCHS=$(/usr/bin/host -l adm.crans.org sable.adm.crans.org | /usr/bin/awk '/^b
|
|||
python $SCRIPT $SWITCHS
|
||||
|
||||
CORPS=$(python $ANALYZER)
|
||||
LENGTH=$(echo $CORPS | wc -l)
|
||||
if [ $LENGTH -ge 2 ]; then
|
||||
LENGTH=$(echo $CORPS | wc -c)
|
||||
if [ $LENGTH -ge 10 ]; then
|
||||
(
|
||||
cat <<EOF
|
||||
To: test@lists.crans.org
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue