mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2025-02-21 18:06:46 +00:00
iputil: use explicit /sbin/ifconfig, to avoid depending upon PATH
This commit is contained in:
parent
2c261ce996
commit
b5bf2baa9b
@ -17,8 +17,8 @@ def get_local_addresses():
|
|||||||
# this. For right now, I'm running ifconfig and grepping for the 'inet '
|
# this. For right now, I'm running ifconfig and grepping for the 'inet '
|
||||||
# lines.
|
# lines.
|
||||||
|
|
||||||
cmd = "ifconfig"
|
cmd = "/sbin/ifconfig"
|
||||||
p = os.popen("ifconfig")
|
p = os.popen(cmd)
|
||||||
addresses = []
|
addresses = []
|
||||||
for line in p.readlines():
|
for line in p.readlines():
|
||||||
# linux shows: " inet addr:1.2.3.4 Bcast:1.2.3.255..."
|
# linux shows: " inet addr:1.2.3.4 Bcast:1.2.3.255..."
|
||||||
@ -37,8 +37,8 @@ def get_local_addresses_async():
|
|||||||
# lines.
|
# lines.
|
||||||
|
|
||||||
# I'd love to do this synchronously.
|
# I'd love to do this synchronously.
|
||||||
cmd = "ifconfig"
|
cmd = "/sbin/ifconfig"
|
||||||
d = getProcessOutput("ifconfig")
|
d = getProcessOutput(cmd)
|
||||||
def _parse(output):
|
def _parse(output):
|
||||||
addresses = []
|
addresses = []
|
||||||
for line in StringIO(output).readlines():
|
for line in StringIO(output).readlines():
|
||||||
|
Loading…
x
Reference in New Issue
Block a user