fix get_local_ipv4 on 12.04

This commit is contained in:
j 2014-05-25 14:40:57 +02:00
parent 98d1725d19
commit 04cdb8f5b5

View file

@ -168,7 +168,7 @@ def get_local_ipv4():
if local: if local:
dev = local[0].split(' ')[4] dev = local[0].split(' ')[4]
local_ip = [l for l in stdout.split('\n') local_ip = [l for l in stdout.split('\n')
if dev in l and not 'default' in l] if dev in l and not 'default' in l and 'src' in l]
ip = [p for p in local_ip[0].split(' ')[1:] if '.' in p][0] ip = [p for p in local_ip[0].split(' ')[1:] if '.' in p][0]
return ip return ip