Skip to content

Commit

Permalink
fixup! Fix various issues found by ruff linter rules
Browse files Browse the repository at this point in the history
  • Loading branch information
martinhoyer committed May 21, 2024
1 parent c446575 commit ae257a9
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions rtslib/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -415,9 +415,10 @@ def modprobe(module):
import kmod.error
import kmod.Kmod
except ImportError:
out = subprocess.run(["modprobe", module], shell=True, capture_output=True, check=False) # noqa: S602, S607
out = subprocess.run(f"modprobe {module}", shell=True, capture_output=True, check=False) # noqa: S602, S607
if out.returncode != 0:
raise RTSLibError(out.stderr.decode().rstrip())
return

try:
kmod.Kmod().modprobe(module)
Expand All @@ -428,7 +429,7 @@ def mount_configfs():
config_dir = "/sys/kernel/config"
config_path = Path(config_dir)
if not config_path.is_mount():
cmdline = ["mount", "-t", "configfs", "none", config_dir]
cmdline = ["mount -t configfs none {config_dir}"]
out = subprocess.run(cmdline, shell=True, capture_output=True, check=False) # noqa: S602
if out.returncode != 0 and not config_path.is_mount():
raise RTSLibError("Cannot mount configfs")
Expand Down

0 comments on commit ae257a9

Please sign in to comment.