You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by ey...@apache.org on 2011/12/14 08:21:28 UTC

svn commit: r1214072 - in /incubator/ambari/trunk: CHANGES.txt agent/src/main/python/ambari_agent/Hardware.py

Author: eyang
Date: Wed Dec 14 07:21:28 2011
New Revision: 1214072

URL: http://svn.apache.org/viewvc?rev=1214072&view=rev
Log:
AMBARI-162. Fixed agent unit test failure when ethernet is not in used. (Eric Yang)

Modified:
    incubator/ambari/trunk/CHANGES.txt
    incubator/ambari/trunk/agent/src/main/python/ambari_agent/Hardware.py

Modified: incubator/ambari/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/CHANGES.txt?rev=1214072&r1=1214071&r2=1214072&view=diff
==============================================================================
--- incubator/ambari/trunk/CHANGES.txt (original)
+++ incubator/ambari/trunk/CHANGES.txt Wed Dec 14 07:21:28 2011
@@ -2,6 +2,8 @@ Ambari Change log
 
 Release 0.1.0 - unreleased
 
+  AMBARI-162. Fixed agent unit test failure when ethernet is not in used. (Eric Yang)
+
   AMBARI-161. Add puppet module for Hadoop to agent resources (vgogate)
 
   AMBARI-159. Temporarily disabled security (until Ambari upgrades to 

Modified: incubator/ambari/trunk/agent/src/main/python/ambari_agent/Hardware.py
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/agent/src/main/python/ambari_agent/Hardware.py?rev=1214072&r1=1214071&r2=1214072&view=diff
==============================================================================
--- incubator/ambari/trunk/agent/src/main/python/ambari_agent/Hardware.py (original)
+++ incubator/ambari/trunk/agent/src/main/python/ambari_agent/Hardware.py Wed Dec 14 07:21:28 2011
@@ -76,7 +76,10 @@ class Hardware:
       # No ethernet detected, detect airport
       script = [ '/System/Library/PrivateFrameworks/Apple80211.framework/Versions/A/Resources/airport', '-I', '|', 'grep', 'lastTxRate:', '|', 'sed', "'s/.*: //'", '|', 'sed', "'s/$//'"]
       result = sh.run(script)
-    self.netSpeed = int(result['output'].rstrip())
+    try:
+      self.netSpeed = int(result['output'].rstrip())
+    except Exception:
+      self.netSpeed = 0
 
   def scanOS(self):
     self.arch = platform.processor()