[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
|
# On retire les machines associées à l'adhérent possédant la chambre
|
||||||
if groupe == 'chambre':
|
if groupe == 'chambre':
|
||||||
for i in liste_associes:
|
for i in liste_associes:
|
||||||
|
try:
|
||||||
proprio_associe = ldap.search('macAddress=%s' % i)[0].proprio()
|
proprio_associe = ldap.search('macAddress=%s' % i)[0].proprio()
|
||||||
if str(proprio_associe['chbre']).lower() == entry[groupe]:
|
if str(proprio_associe['chbre']).lower() == entry[groupe]:
|
||||||
liste_associes.remove(i)
|
liste_associes.remove(i)
|
||||||
|
except:
|
||||||
|
pass
|
||||||
if len(liste_associes) < mac_prise.tres_suspect[duree][groupe]:
|
if len(liste_associes) < mac_prise.tres_suspect[duree][groupe]:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
@ -118,11 +121,13 @@ def genere_comptage(duree, groupe, associes):
|
||||||
largeurs = (longueur[groupe][0], longueur_max)
|
largeurs = (longueur[groupe][0], longueur_max)
|
||||||
|
|
||||||
data = []
|
data = []
|
||||||
for clef, valeurs in pb_comptage_suspect.items():
|
clefs = pb_comptage_suspect.keys()
|
||||||
data.append([clef, ", ".join(valeurs)])
|
clefs.sort()
|
||||||
|
for clef in clefs:
|
||||||
|
data.append([clef, ", ".join(pb_comptage_suspect[clef])])
|
||||||
|
|
||||||
output += tableau(data, titres[groupe], largeurs, alignements)
|
output += tableau(data, titres[groupe], largeurs, alignements)
|
||||||
output += "\n\n\n"
|
output += u"\n\n\n"
|
||||||
|
|
||||||
if len(pb_comptage_tres_suspect) > 0:
|
if len(pb_comptage_tres_suspect) > 0:
|
||||||
output += mac_prise.titre_tres_suspect[duree][groupe]+"\n"
|
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)
|
largeurs = (longueur[groupe][0], longueur_max)
|
||||||
|
|
||||||
data = []
|
data = []
|
||||||
for clef, valeurs in pb_comptage_tres_suspect.items():
|
clefs = pb_comptage_tres_suspect.keys()
|
||||||
data.append([clef, ", ".join(valeurs)])
|
clefs.sort()
|
||||||
|
for clef in clefs:
|
||||||
|
data.append([clef, ", ".join(pb_comptage_tres_suspect[clef])])
|
||||||
|
|
||||||
output += tableau(data, titres[groupe], largeurs, alignements)
|
output += tableau(data, titres[groupe], largeurs, alignements)
|
||||||
output += "\n\n\n"
|
output += u"\n\n\n"
|
||||||
|
|
||||||
return output
|
return output
|
||||||
|
|
||||||
|
@ -153,4 +160,4 @@ if __name__ == '__main__':
|
||||||
if len(output) == coupure:
|
if len(output) == coupure:
|
||||||
sys.exit(0)
|
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
|
python $SCRIPT $SWITCHS
|
||||||
|
|
||||||
CORPS=$(python $ANALYZER)
|
CORPS=$(python $ANALYZER)
|
||||||
LENGTH=$(echo $CORPS | wc -l)
|
LENGTH=$(echo $CORPS | wc -c)
|
||||||
if [ $LENGTH -ge 2 ]; then
|
if [ $LENGTH -ge 10 ]; then
|
||||||
(
|
(
|
||||||
cat <<EOF
|
cat <<EOF
|
||||||
To: test@lists.crans.org
|
To: test@lists.crans.org
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue