mirror of
https://git.selfprivacy.org/SelfPrivacy/selfprivacy-rest-api.git
synced 2024-11-22 20:11:30 +00:00
fix: replace os to subprocess
This commit is contained in:
parent
aadf0cb1a3
commit
446220a9c5
|
@ -1,5 +1,4 @@
|
||||||
import re
|
import re
|
||||||
import os
|
|
||||||
import subprocess
|
import subprocess
|
||||||
|
|
||||||
from selfprivacy_api.utils.huey import huey
|
from selfprivacy_api.utils.huey import huey
|
||||||
|
@ -13,7 +12,7 @@ CLEAR_COMPLETED = "Cleaning completed."
|
||||||
|
|
||||||
|
|
||||||
def run_nix_store_print_dead():
|
def run_nix_store_print_dead():
|
||||||
os.system("nix-env -p /nix/var/nix/profiles/system --delete-generations old")
|
subprocess.run(["nix-env", "-p", "/nix/var/nix/profiles/system", "--delete-generations old"], check=False)
|
||||||
|
|
||||||
return subprocess.check_output(["nix-store", "--gc", "--print-dead"]).decode(
|
return subprocess.check_output(["nix-store", "--gc", "--print-dead"]).decode(
|
||||||
"utf-8"
|
"utf-8"
|
||||||
|
|
Loading…
Reference in a new issue