Skip to content

Commit 28d3a47

Browse files
committed
Stop using "type veth" option of ip command
the option is not supported in Ubuntu 14.04
1 parent 8dd77e7 commit 28d3a47

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

lib/phut/netns.rb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
require 'phut/finder'
33
require 'phut/route'
44
require 'phut/shell_runner'
5+
require 'phut/veth'
56

67
module Phut
78
# `ip netns ...` command runner
@@ -62,8 +63,8 @@ def stop
6263
end
6364

6465
def device
65-
if /^\d+: ([^@]+)@/ =~
66-
sudo("ip netns exec #{name} ip -o link show type veth")
66+
if /^\d+: (#{Phut::Veth::PREFIX}[^@\.]+)@/ =~
67+
sudo("ip netns exec #{name} ip -o link show")
6768
Regexp.last_match(1)
6869
end
6970
end

0 commit comments

Comments
 (0)