* Quelques erreurs, maintenant ça marche
This commit is contained in:
parent
6b55396794
commit
d12ad982cd
3 changed files with 7 additions and 3 deletions
|
@ -474,7 +474,7 @@ class ip6HostNumber(Attr):
|
|||
can_modify = [nounou]
|
||||
|
||||
def parse_value(self, ip, ldif):
|
||||
ip = ip6_of_mac(ldif['macAddress'][0], ldif['rid'][0])
|
||||
ip = ip6_of_mac(ldif['macAddress'][0], int(ldif['rid'][0]))
|
||||
self.value = netaddr.ip.IPAddress(ip)
|
||||
|
||||
def __unicode__(self):
|
||||
|
@ -506,7 +506,7 @@ class rid(Attr):
|
|||
|
||||
# On veut éviter les rid qui recoupent les ipv4 finissant par
|
||||
# .0 ou .255
|
||||
plages = [xrange(rid[a][0], rid[a][1]+1) for a in rid.keys() if 'v6' not in a]
|
||||
plages = [xrange(config.rid[a][0], config.rid[a][1]+1) for a in config.rid.keys() if 'v6' not in a]
|
||||
|
||||
for plage in plages:
|
||||
if rid in plage:
|
||||
|
|
|
@ -60,6 +60,7 @@ def prefixev6_of_rid(rid):
|
|||
|
||||
Cette fonction retourne l'ip de début de ce sous-réseau.
|
||||
"""
|
||||
# Au cas où
|
||||
rid = int(rid)
|
||||
|
||||
for net, plage in config.rid.items():
|
||||
|
@ -75,6 +76,8 @@ def ip6_of_mac(mac, rid):
|
|||
"""
|
||||
Retourne la bonne ipv6 de la machine en fonction de sa mac et de son rid.
|
||||
"""
|
||||
# Au cas où
|
||||
rid = int(rid)
|
||||
|
||||
for net, plage in config.rid.items():
|
||||
if rid >= plage[0] and rid <= plage[1]:
|
||||
|
|
|
@ -325,7 +325,8 @@ class lc_ldap(ldap.ldapobject.LDAPObject):
|
|||
if i in nonfree:
|
||||
continue
|
||||
else:
|
||||
my_id = attrify(i, attr, self, True)
|
||||
# On crée l'attribut associé, pour parser sa valeur.
|
||||
my_id = attrify(unicode(i), attr, {}, self, False)
|
||||
if my_id.value != i:
|
||||
continue
|
||||
else:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue