From d343c40b1f3e5e2163308b705effd7f087378705 Mon Sep 17 00:00:00 2001 From: Stanislaw Adaszewski Date: Tue, 28 Apr 2020 00:17:15 +0200 Subject: [PATCH] Fix in compose build_volumes() --- focker/compose.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/focker/compose.py b/focker/compose.py index 1250586..bdfb4f6 100644 --- a/focker/compose.py +++ b/focker/compose.py @@ -11,7 +11,8 @@ from .zfs import AmbiguousValueError, \ zfs_find, \ zfs_tag, \ zfs_untag, \ - zfs_mountpoint + zfs_mountpoint, \ + zfs_poolname from .jail import jail_fs_create, \ jail_create, \ jail_remove @@ -23,6 +24,7 @@ import os def build_volumes(spec): + poolname = zfs_poolname() for tag in spec.keys(): try: name, _ = zfs_find(tag, focker_type='volume') @@ -33,7 +35,7 @@ def build_volumes(spec): pass sha256 = random_sha256_hexdigest() name = find_prefix(poolname + '/focker/volumes/', sha256) - subprocess.check_output(['zfs', 'create', name]) + subprocess.check_output(['zfs', 'create', '-o', 'focker:sha256=' + sha256, name]) zfs_untag([ tag ], focker_type='volume') zfs_tag(name, [ tag ])