Use noserverino option in cifs mounts (#4398)

This commit is contained in:
Mike Degatano 2023-06-21 12:49:03 -04:00 committed by GitHub
parent 35bd66119a
commit d3031e2eae
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 5 deletions

View File

@ -383,7 +383,7 @@ class CIFSMount(NetworkMount):
@property
def options(self) -> list[str]:
"""Options to use to mount."""
options = super().options
options = super().options + ["noserverino"]
if self.version:
options.append(f"vers={self.version}")

View File

@ -116,7 +116,7 @@ async def test_load(
"mnt-data-supervisor-mounts-backup_test.mount",
"fail",
[
["Options", Variant("s", "guest")],
["Options", Variant("s", "noserverino,guest")],
["Type", Variant("s", "cifs")],
["Description", Variant("s", "Supervisor cifs mount: backup_test")],
["What", Variant("s", "//backup.local/backups")],

View File

@ -77,7 +77,7 @@ async def test_cifs_mount(
assert mount.what == "//test.local/camera"
assert mount.where == Path("/mnt/data/supervisor/mounts/test")
assert mount.local_where == tmp_supervisor_data / "mounts" / "test"
assert mount.options == expected_options + [
assert mount.options == ["noserverino"] + expected_options + [
f"username={mount_data['username']}",
f"password={mount_data['password']}",
]
@ -104,7 +104,8 @@ async def test_cifs_mount(
Variant(
"s",
",".join(
expected_options
["noserverino"]
+ expected_options
+ [
f"username={mount_data['username']}",
f"password={mount_data['password']}",
@ -215,7 +216,7 @@ async def test_load(
"mnt-data-supervisor-mounts-test.mount",
"fail",
[
["Options", Variant("s", "guest")],
["Options", Variant("s", "noserverino,guest")],
["Type", Variant("s", "cifs")],
["Description", Variant("s", "Supervisor cifs mount: test")],
["What", Variant("s", "//test.local/share")],