OSDN Git Service

refactoring VethAgent
[ti2/ti2.git] / 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)