|
|
@ -453,8 +453,13 @@ class LinuxNetwork(Network):
|
|
|
|
ipv4_address = None,
|
|
|
|
ipv4_address = None,
|
|
|
|
ipv6_address = None
|
|
|
|
ipv6_address = None
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
ipbin = '/sbin/ip'
|
|
|
|
output = subprocess.Popen(['ip','addr'], stdout=subprocess.PIPE).communicate()[0]
|
|
|
|
if not os.path.exists(ipbin):
|
|
|
|
|
|
|
|
if os.path.exists('/usr/sbin/ip'):
|
|
|
|
|
|
|
|
ipbin = '/usr/sbin/ip'
|
|
|
|
|
|
|
|
else:
|
|
|
|
|
|
|
|
return interfaces, ips
|
|
|
|
|
|
|
|
output = subprocess.Popen([ipbin, 'addr', 'show'], stdout=subprocess.PIPE).communicate()[0]
|
|
|
|
for line in output.split('\n'):
|
|
|
|
for line in output.split('\n'):
|
|
|
|
if line:
|
|
|
|
if line:
|
|
|
|
words = line.split()
|
|
|
|
words = line.split()
|
|
|
|