Skip to content

Commit cb90ae6

Browse files
committed
add & use general options parameter to umount
1 parent 4d2bfd7 commit cb90ae6

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

iocage/lib/Jail.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -542,7 +542,10 @@ def create(self, release_name: str) -> None:
542542
self.get_or_create_dataset("root")
543543
self._update_fstab()
544544

545-
backend = None
545+
backend: typing.Optional[typing.Union[
546+
iocage.lib.StandaloneJailStorage.StandaloneJailStorage,
547+
iocage.lib.NullFSBasejailStorage.NullFSBasejailStorage,
548+
iocage.lib.ZFSBasejailStorage.ZFSBasejailStorage]] = None
546549

547550
is_basejail = self.config.get("basejail", False)
548551
if not is_basejail:
@@ -1038,14 +1041,14 @@ def _teardown_mounts(self) -> None:
10381041
))
10391042

10401043
iocage.lib.helpers.umount(
1041-
mountpoints,
1044+
mountpoints=mountpoints,
10421045
force=True,
10431046
logger=self.logger,
10441047
ignore_error=True
10451048
)
10461049

10471050
iocage.lib.helpers.umount(
1048-
["-a", "-F", self.fstab.path],
1051+
options=["-a", "-F", self.fstab.path],
10491052
force=True,
10501053
logger=self.logger,
10511054
ignore_error=True

iocage/lib/helpers.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -414,8 +414,9 @@ def shell(
414414
def umount(
415415
mountpoint: typing.Optional[typing.Union[
416416
iocage.lib.Types.AbsolutePath,
417-
typing.List[iocage.lib.Types.AbsolutePath]
417+
typing.List[iocage.lib.Types.AbsolutePath],
418418
]]=None,
419+
options: typing.Optional[typing.List[str]]=None,
419420
force: bool=False,
420421
ignore_error: bool=False,
421422
logger: typing.Optional[iocage.lib.Logger.Logger]=None
@@ -426,6 +427,9 @@ def umount(
426427
if force is True:
427428
cmd.append("-f")
428429

430+
if options is not None and len(options) != 0:
431+
cmd + options
432+
429433
if isinstance(mountpoint, list):
430434
cmd += mountpoint
431435
elif isinstance(mountpoint, iocage.lib.Types.AbsolutePath):

0 commit comments

Comments
 (0)