Skip to content

Commit

Permalink
Merge pull request #2040 from ogayot/guided-direct-netdev
Browse files Browse the repository at this point in the history
guided: set _netdev more consistently (including when doing guided)
  • Loading branch information
ogayot authored Aug 12, 2024
2 parents f0a192d + ecd1d6b commit b6ae568
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 12 deletions.
10 changes: 1 addition & 9 deletions subiquity/common/filesystem/manipulator.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,7 @@ class FilesystemManipulator:
def create_mount(self, fs, spec: FileSystemSpec):
if spec.get("mount") is None:
return
mount = self.model.add_mount(
fs, spec["mount"], on_remote_storage=spec.get("on-remote-storage", False)
)
mount = self.model.add_mount(fs, spec["mount"])
if self.model.needs_bootloader_partition():
vol = fs.volume
if vol.type == "partition" and boot.can_be_boot_device(vol.device):
Expand Down Expand Up @@ -290,9 +288,6 @@ def partition_disk_handler(
):
log.debug("partition_disk_handler: %s %s %s %s", disk, spec, partition, gap)

if disk.on_remote_storage():
spec["on-remote-storage"] = True

if partition is not None:
if "size" in spec and spec["size"] != partition.size:
trailing, gap_size = gaps.movable_trailing_partitions_and_gap_size(
Expand Down Expand Up @@ -347,9 +342,6 @@ def logical_volume_handler(self, vg, spec: LogicalVolumeSpec, *, partition, gap)

log.debug("logical_volume_handler: %s %s %s", vg, lv, spec)

if vg.on_remote_storage():
spec["on-remote-storage"] = True

if lv is not None:
if "name" in spec:
lv.name = spec["name"]
Expand Down
1 change: 0 additions & 1 deletion subiquity/common/filesystem/spec.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ class RaidSpec(TypedDict):
"mount": str | None,
"wipe": str | None, # NOTE: no wipe is different from wipe=None
"use_swap": bool,
"on-remote-storage": bool,
},
total=False,
)
Expand Down
4 changes: 2 additions & 2 deletions subiquity/models/filesystem.py
Original file line number Diff line number Diff line change
Expand Up @@ -2278,11 +2278,11 @@ def remove_filesystem(self, fs):
raise Exception("can only remove unmounted filesystem")
self._remove(fs)

def add_mount(self, fs, path, *, on_remote_storage=False):
def add_mount(self, fs: Filesystem, path):
if fs._mount is not None:
raise Exception(f"{fs} is already mounted")
options = None
if on_remote_storage:
if fs.volume.on_remote_storage():
options = "defaults,_netdev"
m = Mount(m=self, device=fs, path=path, options=options)
self._actions.append(m)
Expand Down

0 comments on commit b6ae568

Please sign in to comment.