From e8c6e4eda31c87d53c49a0ae78af1796c8cc7f87 Mon Sep 17 00:00:00 2001 From: bernat Date: Thu, 12 May 2005 19:08:29 +0200 Subject: [PATCH] Fonction megautile pour renvoyer l'adresse MAC + 2 (marche presque toujours) darcs-hash:20050512170829-d1718-dcea4d470c5e029d066676de5160fe04a9d30ae1.gz --- gestion/ldap_crans.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/gestion/ldap_crans.py b/gestion/ldap_crans.py index 5c60aebc..a253f9b4 100755 --- a/gestion/ldap_crans.py +++ b/gestion/ldap_crans.py @@ -1817,6 +1817,12 @@ class machine(base_classes_crans) : self._set('macAddress',[mac]) return mac + + def mac2(self): + """Retourne l'adresse MAC + 2""" + mac = self.mac().split(":") + mac[-1] = "%0.2x" % (int(mac[-1], 16) + 2) + return ":".join(mac) def __host_alias(self,champ,new) : """ Vérification de la validité d'un nom de machine """