Search by unicode string
This commit is contained in:
parent
87cc827335
commit
9d4f8a2d73
3 changed files with 5 additions and 5 deletions
|
@ -89,16 +89,16 @@ def get(str):
|
|||
|
||||
def get_machine_by_mac(ip):
|
||||
mac_addr=mac_from_ip(ip)
|
||||
machines = get('macAddress=%s' % mac_addr)
|
||||
machines = get(u'macAddress=%s' % mac_addr)
|
||||
if machines and isinstance(machines[0], lc_ldap.objets.machineWifi):
|
||||
if not 'ipHostNumber' in machines[0].attrs.keys():
|
||||
machine = QUERY.search('macAddress=%s' % mac_addr, mode='rw')[0]
|
||||
machine = QUERY.search(u'macAddress=%s' % mac_addr, mode='rw')[0]
|
||||
machine.set_ipv4()
|
||||
return machines
|
||||
|
||||
|
||||
def get_machine_by_ip(ip):
|
||||
return get('ipHostNumber=%s' % ip)
|
||||
return get(u'ipHostNumber=%s' % ip)
|
||||
|
||||
def get_page(ip, by_mac=False, accueil=False):
|
||||
try:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue