For USB ethernet device, it failed by directory existed but the two files (device and vendor) not exited. So now check the two files to ensure the present of Ethernet device.

Also fix a bug that not output of lspci/lsusb was considered as device exists.

BUG=3578

Review URL: http://codereview.chromium.org/2279001
(cherry picked from commit 6006f33dc8c9ae955c6ac041d8fe54fb9873aea1)
diff --git a/client/site_tests/hardware_Components/hardware_Components.py b/client/site_tests/hardware_Components/hardware_Components.py
index 29535a4..157ac86 100644
--- a/client/site_tests/hardware_Components/hardware_Components.py
+++ b/client/site_tests/hardware_Components/hardware_Components.py
@@ -96,11 +96,14 @@
         """
         # Ethernet is optional so mark it as not present. A human
         # operator needs to decide if this is acceptable or not.
-        if not os.path.exists('/sys/class/net/eth0'):
-            return self._not_present
-        part_id = utils.read_one_line('/sys/class/net/eth0/device/device')
-        vendor_id = utils.read_one_line('/sys/class/net/eth0/device/vendor')
-        return "%s:%s" % (vendor_id.replace('0x',''), part_id.replace('0x',''))
+        vendor_file = '/sys/class/net/eth0/device/vendor'
+        part_file = '/sys/class/net/eth0/device/device'
+        if os.path.exists(part_file) and os.path.exists(vendor_file):
+          vendor_id = utils.read_one_line(vendor_file).replace('0x', '')
+          part_id = utils.read_one_line(part_file).replace('0x', '')
+          return "%s:%s" % (vendor_id, part_id)
+        else:
+          return self._not_present
 
 
     def get_part_id_flash_chip(self):
@@ -149,9 +152,11 @@
 
         for device in approved_devices:
             try:
-                utils.system(cmd % device)
-                self._system[cid] = [ device ]
-                return
+                output = utils.system_output(cmd % device)
+                # If it shows something, means found.
+                if output:
+                  self._system[cid] = [ device ]
+                  return
             except:
                 pass
         self._failures[cid] = [ 'No match' ]