OSDN Git Service

refactoring VethAgent
authort.moriyama <t.moriyama@users.sourceforge.jp>
Sat, 20 Jul 2013 18:39:41 +0000 (03:39 +0900)
committert.moriyama <t.moriyama@users.sourceforge.jp>
Sat, 20 Jul 2013 18:39:41 +0000 (03:39 +0900)
linkpair/collect/agent/veth_agent.py

index 04796c0..73e01dd 100755 (executable)
@@ -20,10 +20,10 @@ class VethAgent(BaseAgent):
 
     def pick_veth_configuration(self):
         if_name = ""
-        result = self._runner.exec_cmd("ifconfig -a")
+        result = self._runner.exec_cmd("ip link show")
         for if_line in result:
             if_line = if_line.rstrip()
-            if self._u.d_push(re.match(r'^(\S+)\s+', if_line)) is not None:
+            if self._u.d_push(re.match(r'^\d+:\s(\S+):', if_line)) is not None:
                 match = self._u.d_pop()
                 if_name = match.group(1)
                 result2 = self._runner.exec_cmd("ethtool -S " + if_name)