Fix: Use --print-out-paths instead of ./result symlink in verify-integrity endpoint
Agent-Logs-Url: https://github.com/naturallaw777/staging_alpha/sessions/b365659c-e6c9-45bf-9b12-b89addfbbbdd Co-authored-by: naturallaw777 <99053422+naturallaw777@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
bf9e82cd79
commit
5bd5c03e2f
@@ -3088,13 +3088,12 @@ async def api_security_verify_integrity():
|
||||
try:
|
||||
current_system_path = os.path.realpath("/run/current-system")
|
||||
result = subprocess.run(
|
||||
["/run/current-system/sw/bin/nixos-rebuild", "build", "--flake", "/etc/nixos", "--no-build-output"],
|
||||
["/run/current-system/sw/bin/nixos-rebuild", "build", "--flake", "/etc/nixos",
|
||||
"--no-build-output", "--print-out-paths"],
|
||||
capture_output=True, text=True, timeout=600,
|
||||
)
|
||||
if result.returncode == 0:
|
||||
# nixos-rebuild build creates ./result symlink in cwd
|
||||
result_path = os.path.realpath("result")
|
||||
expected_system_path = result_path
|
||||
expected_system_path = result.stdout.strip()
|
||||
system_matches = (current_system_path == expected_system_path)
|
||||
except subprocess.TimeoutExpired:
|
||||
expected_system_path = "Build timed out"
|
||||
|
||||
Reference in New Issue
Block a user