nixos-rebuild-ng: use Path.resolve() instead of readlink() (#384060)
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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"),
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user