auth.py: enregistre mac *et/ou* rid
This commit is contained in:
parent
132636e7f9
commit
ea4e86dbdd
1 changed files with 4 additions and 4 deletions
|
@ -209,8 +209,8 @@ def get_fresh_rid(machine):
|
|||
machine.conn.lockholder.purge(lockId)
|
||||
|
||||
@use_ldap_admin
|
||||
def register_mac(data, machine, conn):
|
||||
"""Enregistre la mac actuelle sur une machine donnée."""
|
||||
def register_machine(data, machine, conn):
|
||||
"""Enregistre la mac actuelle et/ou assigne le rid sur une machine donnée."""
|
||||
# TODO lc_ldap devrait posséder une fonction pour passer en rw depuis un ro
|
||||
if 'w' not in machine.mode:
|
||||
machine = conn.search(dn=machine.dn, scope=ldap.SCOPE_BASE, mode='rw')[0]
|
||||
|
@ -427,8 +427,8 @@ def decide_vlan(data, is_wifi, conn):
|
|||
proprio = machine.proprio()
|
||||
|
||||
# Avant de continuer, on assigne la mac à la machine candidat
|
||||
if '<automatique>' in machine['macAddress']:
|
||||
register_mac(data, machine)
|
||||
if '<automatique>' in machine['macAddress'] or not machine['rid']:
|
||||
register_machine(data, machine)
|
||||
|
||||
if not machine['ipHostNumber']:
|
||||
decision = 'v6only', u'No IPv4'
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue