diff options
| author | Viacheslav Hletenko <v.gletenko@vyos.io> | 2026-04-17 13:00:45 +0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-04-17 13:00:45 +0300 |
| commit | a8187bb23035fe13a5a8942ad3768d5a6c819232 (patch) | |
| tree | 039fb6f0b09f14d39ca50b43664d0d5a7746c48c /src | |
| parent | 5c2973e5d853ff921d48ae214ec0d2554e33515c (diff) | |
| parent | 4a5cb1db2b35f4300552717f75422376f381b3bd (diff) | |
| download | vyos-1x-a8187bb23035fe13a5a8942ad3768d5a6c819232.tar.gz vyos-1x-a8187bb23035fe13a5a8942ad3768d5a6c819232.zip | |
Merge pull request #5122 from c-po/op-mode-sensors
op-mode: T8483: fix /show_sensors.py: No such file or directory
Diffstat (limited to 'src')
| -rwxr-xr-x | src/op_mode/show_sensors.py | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/op_mode/show_sensors.py b/src/op_mode/show_sensors.py index 1efcc9aec..b7ff05178 100755 --- a/src/op_mode/show_sensors.py +++ b/src/op_mode/show_sensors.py @@ -17,25 +17,26 @@ import re import sys + from vyos.utils.process import popen from vyos.utils.process import DEVNULL -output,retcode = popen("sensors --no-adapter", stderr=DEVNULL) +output, retcode = popen("sensors --no-adapter", stderr=DEVNULL) if retcode == 0: print (output) sys.exit(0) else: - output,retcode = popen("sensors-detect --auto",stderr=DEVNULL) - match = re.search(r'#----cut here----(.*)#----cut here----',output, re.DOTALL) + output, retcode = popen("sensors-detect --auto", stderr=DEVNULL) + match = re.search(r'#----cut here----(.*)#----cut here----', output, + re.DOTALL) if match: for module in match.group(0).split('\n'): if not module.startswith("#"): popen("modprobe {}".format(module.strip())) - output,retcode = popen("sensors --no-adapter", stderr=DEVNULL) + output, retcode = popen("sensors --no-adapter", stderr=DEVNULL) if retcode == 0: - print (output) + print(output) sys.exit(0) - -print ("No sensors found") +print("No sensors found") sys.exit(1) |
