From 6488af5688d2acb996cdf5a4bdd446cd3c52e8e0 Mon Sep 17 00:00:00 2001 From: chove Date: Wed, 26 Oct 2005 17:06:54 +0200 Subject: [PATCH] utilisation de startwith / unicode darcs-hash:20051026150654-4ec08-f10d67b57cc1236076ed92a9ed631533a1b388cb.gz --- gestion/ldap_crans.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gestion/ldap_crans.py b/gestion/ldap_crans.py index bfc5880b..1cba9cb2 100755 --- a/gestion/ldap_crans.py +++ b/gestion/ldap_crans.py @@ -1954,12 +1954,12 @@ class machine(base_classes_crans) : vendor = '' try: for line in open('/usr/scripts/gestion/ethercodes.dat').readlines() : - if line.find(prefix)==0 : + if line.startswith(prefix) : vendor = line.replace(prefix,'').strip() break except IOError: # Le fichier existe pas, on sors - raise RuntimeError("Fichier de fabiquants de MAC non trouvé !") + raise RuntimeError(u"Fichier de fabiquants de MAC non trouvé !") if not vendor : raise ValueError(u"Le constructeur correspondant à cette adresse MAC ne peut être trouvé.\nL'adresse MAC correspond peut-être à un pont réseau, désactivez ce pont réseau.\nContactez nounou si la MAC est bien celle d'une carte.",2)