]> git.rkrishnan.org Git - tahoe-lafs/tahoe-lafs.git/commitdiff
iputil: use explicit /sbin/ifconfig, to avoid depending upon PATH
authorBrian Warner <warner@lothar.com>
Thu, 8 Mar 2007 01:47:40 +0000 (18:47 -0700)
committerBrian Warner <warner@lothar.com>
Thu, 8 Mar 2007 01:47:40 +0000 (18:47 -0700)
src/allmydata/util/iputil.py

index 2e31ad53c7433394f3d4d9411cea82bb46894188..f849b00071f1f2d73f334937edd35339c3350317 100644 (file)
@@ -17,8 +17,8 @@ def get_local_addresses():
     # this. For right now, I'm running ifconfig and grepping for the 'inet '
     # lines.
 
-    cmd = "ifconfig"
-    p = os.popen("ifconfig")
+    cmd = "/sbin/ifconfig"
+    p = os.popen(cmd)
     addresses = []
     for line in p.readlines():
         # linux shows: "   inet addr:1.2.3.4  Bcast:1.2.3.255..."
@@ -37,8 +37,8 @@ def get_local_addresses_async():
     # lines.
 
     # I'd love to do this synchronously.
-    cmd = "ifconfig"
-    d = getProcessOutput("ifconfig")
+    cmd = "/sbin/ifconfig"
+    d = getProcessOutput(cmd)
     def _parse(output):
         addresses = []
         for line in StringIO(output).readlines():