Commit d9bdc2ed authored by Valentin Samir's avatar Valentin Samir

DeprecationWarning: attrify ne devrait être appelé qu'avec des unicode

parent bc86e746
......@@ -21,8 +21,8 @@ get_machine = conn_pool.get_machine
def create_machine(user, type, mac, host, club=None):
ldif = {
'macAddress': ['%s' % mac.encode('utf-8')],
'host': ['%s' % host.encode('utf-8')]
'macAddress': [u'%s' % mac.encode('utf-8')],
'host': [u'%s' % host.encode('utf-8')]
}
if club:
luser = conn_pool.get_conn(user).search(u'cid=%s' % club)[0]
......@@ -30,7 +30,7 @@ def create_machine(user, type, mac, host, club=None):
luser = get_user(user)
with conn_pool.get_conn(user).newMachine(luser.dn, type, ldif, user.username) as machine:
if type in ["wifi-adh", "wifi-adh-v6"]:
machine['ipsec']='auto'
machine['ipsec']=u'auto'
machine.create(login=user.username)
conn_pool.get_user(user, refresh=True)
return machine
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment