Skip to content

Commit

Permalink
update ioc_check.py - automatically create missing datasets with prefix
Browse files Browse the repository at this point in the history
  • Loading branch information
Defenso-QTH committed Sep 22, 2024
1 parent 48c254e commit f5c0fb4
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions iocage_lib/ioc_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,9 @@ def __init__(
self.__check_datasets__()

self.pool_root_dataset = Dataset(self.pool, cache=reset_cache)
prefix = self.pool_root_dataset.properties.get(IOCAGE_PREFIX_PROP, '')
self.prefix = self.pool_root_dataset.properties.get(IOCAGE_PREFIX_PROP, '')
self.iocage_dataset = Dataset(
os.path.join(self.pool, prefix, 'iocage'), cache=reset_cache
os.path.join(self.pool, self.prefix, 'iocage'), cache=reset_cache
)

if migrate:
Expand Down Expand Up @@ -88,6 +88,10 @@ def __check_datasets__(self):
datasets = ("iocage", "iocage/download", "iocage/images",
"iocage/jails", "iocage/log", "iocage/releases",
"iocage/templates")
if self.prefix != '':
datasets = (
os.path.join(self.prefix, ioc_ds) for ioc_ds in datasets
)

for dataset in datasets:
zfs_dataset_name = f"{self.pool}/{dataset}"
Expand Down

0 comments on commit f5c0fb4

Please sign in to comment.