Skip to content

Commit

Permalink
fix: speed-ookla can't find speedtest without PATH
Browse files Browse the repository at this point in the history
env should still be copied down (at least for user configurability), and
s.t. subprocess can find speedtest (when not absolute file path).

fix for HOME is preserved, but now only as a fallback, in case it's
missing from the passed-down environ.

bump version 0.0.1-rc.17 → 0.0.1-rc.18

see #48
  • Loading branch information
jesteria committed May 5, 2023
1 parent b7e12df commit 17be4a1
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 11 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "netrics-measurements"
version = "0.0.1-rc.17"
version = "0.0.1-rc.18"
description = "The extensible network measurements framework"
license = "MIT"
authors = [
Expand Down
8 changes: 4 additions & 4 deletions readme.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,14 @@ The one-liner below will install Netrics for the current user:

[source,sh]
----
curl -sL https://github.com/internet-equity/netrics/raw/0.0.1-rc.17/install.py | python3
curl -sL https://github.com/internet-equity/netrics/raw/0.0.1-rc.18/install.py | python3
----

To install Netrics system-wide you might use `sudo`:

[source,sh]
----
curl -sL https://github.com/internet-equity/netrics/raw/0.0.1-rc.17/install.py | sudo python3
curl -sL https://github.com/internet-equity/netrics/raw/0.0.1-rc.18/install.py | sudo python3
----

[TIP]
Expand All @@ -67,15 +67,15 @@ You may pass arguments to the installer – even in the above form – separated
[source,sh]
----
curl -sL https://github.com/internet-equity/netrics/raw/0.0.1-rc.17/install.py | python3 - --help
curl -sL https://github.com/internet-equity/netrics/raw/0.0.1-rc.18/install.py | python3 - --help
----
====

Alternatively, download the installer to interact with it:

[source,console]
----
curl -LO https://github.com/internet-equity/netrics/raw/0.0.1-rc.17/install.py
curl -LO https://github.com/internet-equity/netrics/raw/0.0.1-rc.18/install.py
python3 install.py --help
----
Expand Down
10 changes: 4 additions & 6 deletions src/netrics/measurement/ookla.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"""Measure Internet bandwidth, *etc*., via the Ookla speedtest CLI."""
import json
import os
import re
import subprocess
import tempfile
Expand Down Expand Up @@ -88,13 +89,10 @@ def main(params):
# is inconsequential; however, it cannot be disabled.
#
# As we can't (or don't want to) ensure a real HOME, and
# don't need this record, we'll set it to a temporary
# directory.
# don't need this record, we'll allow it to fall back to
# a temporary directory.
#
# (And speedtest apparently, correctly, requires no other
# envvars, at least.)
#
env={'HOME': tmphome},
env={'HOME': tmphome, **os.environ},
)
except subprocess.TimeoutExpired as exc:
task.log.critical(
Expand Down

0 comments on commit 17be4a1

Please sign in to comment.