From 3c3901544c54659f94b1f8e7ed5ae95cebf8e9b5 Mon Sep 17 00:00:00 2001
From: Anders Blomdell <anders.blomdell@control.lth.se>
Date: Thu, 1 Mar 2018 21:22:47 +0100
Subject: [PATCH] Handle local interfaces correctly
---
src/allclients.py | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/allclients.py b/src/allclients.py
index 725aace..073af18 100644
--- a/src/allclients.py
+++ b/src/allclients.py
@@ -18,9 +18,9 @@ class VerboseOptionParser(optparse.OptionParser):
pass
def local_interfaces():
- ip = subprocess.check_output([ 'ip', 'addr', 'show' ])
- return (re.findall(b'inet\s+([0-9.]+)/[0-9]+', ip, re.MULTILINE) +
- re.findall(b'inet6\s+([0-9a-f:]+)/[0-9]+', ip, re.MULTILINE))
+ ip = subprocess.check_output([ 'ip', 'addr', 'show' ]).decode('utf8')
+ return (re.findall('inet\s+([0-9.]+)/[0-9]+', ip, re.MULTILINE) +
+ re.findall('inet6\s+([0-9a-f:]+)/[0-9]+', ip, re.MULTILINE))
if __name__ == '__main__':
optParser = VerboseOptionParser(usage="%prog [options] command*")
--
GitLab