diff options
author | Rod Smith <rod.smith@canonical.com> | 2016-10-05 12:20:10 -0400 |
---|---|---|
committer | Sylvain Pineau <sylvain.pineau@canonical.com> | 2016-10-09 11:34:34 +0200 |
commit | ced1c5c8a681e8c24969ea2ff07a0d992fa868c1 (patch) | |
tree | b2d28c92cfcf379fcc7e0154349a111e38dcf5a4 | |
parent | 326c0986ab795a926d58de69c5f64fedc7dc5130 (diff) |
Fix failure to detect network speed on ARM64 system (Cavium Thunder)
-rwxr-xr-x | bin/network | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/bin/network b/bin/network index a7f4b888..190b68f8 100755 --- a/bin/network +++ b/bin/network @@ -296,14 +296,14 @@ class Interface(socket.socket): logging.error(e.output) ethinfo = None finally: - expression = '(\\d+)(base)([A-Z]+)' + expression = '(\\d+)(base)([A-Z]+)|(\d+)(Mb/s)' regex = re.compile(expression) speeds = [0] if ethinfo: for i in ethinfo: hit = regex.search(i) if hit: - speeds.append(int(hit.group(1))) + speeds.append(int(re.sub("\D", "", hit.group(0)))) return max(speeds) @property |