Skip to content

Instantly share code, notes, and snippets.

@abadger
Created December 2, 2021 16:47
Show Gist options
  • Save abadger/615c9d85a201c3f61c6673172e3a7b46 to your computer and use it in GitHub Desktop.
Save abadger/615c9d85a201c3f61c6673172e3a7b46 to your computer and use it in GitHub Desktop.
Example of easy porting of run_suprocess to use a list
diff --git a/convert2rhel/checks.py b/convert2rhel/checks.py
index 1bb5dff..ebe481f 100644
--- a/convert2rhel/checks.py
+++ b/convert2rhel/checks.py
@@ -105,7 +105,7 @@ def check_tainted_kmods():
system76_io 16384 0 - Live 0x0000000000000000 (OE) <<<<<< Tainted
system76_acpi 16384 0 - Live 0x0000000000000000 (OE) <<<<< Tainted
"""
- unsigned_modules, _ = run_subprocess("grep '(' /proc/modules")
+ unsigned_modules, _ = run_subprocess(["grep", "('", "/proc/modules"])
module_names = "\n ".join([mod.split(" ")[0] for mod in unsigned_modules.splitlines()])
if unsigned_modules:
logger.critical(
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment