Skip to content

Commit

Permalink
more elegant conditional without hardcoded path
Browse files Browse the repository at this point in the history
  • Loading branch information
benjamink committed Sep 4, 2023
1 parent 2b9442c commit 60180cd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions python/common/src/piscsi/sys_cmds.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"""
import subprocess
import logging
import os
import sys
from subprocess import run, CalledProcessError
from shutil import disk_usage
from re import findall, match
Expand Down Expand Up @@ -281,7 +281,7 @@ def get_throttled(enabled_modes, test_modes):
they're triggered. test_modes works similarly to enabled_mode but will
ALWAYS display the modes listed for troubleshooting styling.
"""
if os.path.exists("/usr/bin/vcgencmd"):
if "vcgencmd" in sys.modules:
vcgcmd = Vcgencmd()
t_states = vcgcmd.get_throttled()["breakdown"]
matched_states = []
Expand Down

0 comments on commit 60180cd

Please sign in to comment.