Unverified Commit e5ecf39d authored by Thiago Kenji Okada's avatar Thiago Kenji Okada Committed by GitHub
Browse files

nixos-rebuild-ng: use Path.resolve() instead of readlink() (#384060)

parents e26948d5 89121503
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -140,8 +140,7 @@ class Flake:
                default_path = Path("/etc/nixos/flake.nix")
                if default_path.exists():
                    # It can be a symlink to the actual flake.
                    if default_path.is_symlink():
                        default_path = default_path.readlink()
                    default_path = default_path.resolve()
                    return cls.parse(str(default_path.parent), get_hostname)
                else:
                    return None
+1 −1
Original line number Diff line number Diff line
@@ -140,7 +140,7 @@ def test_flake_from_arg(
            return_value=True,
        ),
        patch(
            get_qualified_name(m.Path.readlink, m),
            get_qualified_name(m.Path.resolve, m),
            autospec=True,
            return_value=Path("/path/to/flake.nix"),
        ),