Merge ~jibel/curtin/+git/lp_1823682:lp_1823682 into curtin:master

Proposed by Jean-Baptiste Lallement
Status: Merged
Approved by: Ryan Harper
Approved revision: 616945abe0d094801eeb4f5dc8c73995335a0788
Merge reported by: Server Team CI bot
Merged at revision: not available
Proposed branch: ~jibel/curtin/+git/lp_1823682:lp_1823682
Merge into: curtin:master
Diff against target: 53 lines (+14/-5)
2 files modified
curtin/commands/block_meta.py (+5/-1)
tests/unittests/test_commands_block_meta.py (+9/-4)
Reviewer Review Type Date Requested Status
Ryan Harper (community) Approve
Server Team CI bot continuous-integration Approve
Review via email: mp+365666@code.launchpad.net

Commit message

zfs: pass pool and fs properties to zpool_create

block-meta use of zpool_create did not supply the optional parameters
that are supported in the zfs/zpool configuration dictionary. Fix
this by extracting the values from the config and passing them
to zpool_create.

LP: #1823682

To post a comment you must log in.
Revision history for this message
Server Team CI bot (server-team-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
Ryan Harper (raharper) wrote :

Thanks for finding this!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/curtin/commands/block_meta.py b/curtin/commands/block_meta.py
2index b108aca..79493fc 100644
3--- a/curtin/commands/block_meta.py
4+++ b/curtin/commands/block_meta.py
5@@ -1455,6 +1455,8 @@ def zpool_handler(info, storage_config):
6 for v in info.get('vdevs', [])]
7 poolname = info.get('pool')
8 mountpoint = info.get('mountpoint')
9+ pool_properties = info.get('pool_properties', {})
10+ fs_properties = info.get('fs_properties', {})
11 altroot = state['target']
12
13 if not vdevs or not poolname:
14@@ -1474,7 +1476,9 @@ def zpool_handler(info, storage_config):
15
16 LOG.info('Creating zpool %s with vdevs %s', poolname, vdevs_byid)
17 zfs.zpool_create(poolname, vdevs_byid,
18- mountpoint=mountpoint, altroot=altroot)
19+ mountpoint=mountpoint, altroot=altroot,
20+ pool_properties=pool_properties,
21+ zfs_properties=fs_properties)
22
23
24 def zfs_handler(info, storage_config):
25diff --git a/tests/unittests/test_commands_block_meta.py b/tests/unittests/test_commands_block_meta.py
26index 20f0d87..b4a9afa 100644
27--- a/tests/unittests/test_commands_block_meta.py
28+++ b/tests/unittests/test_commands_block_meta.py
29@@ -339,15 +339,20 @@ class TestZpoolHandler(CiTestCase):
30 m_zfs):
31 storage_config = OrderedDict()
32 info = {'type': 'zpool', 'id': 'myrootfs_zfsroot_pool',
33- 'pool': 'rpool', 'vdevs': ['disk1p1'], 'mountpoint': '/'}
34+ 'pool': 'rpool', 'vdevs': ['disk1p1'], 'mountpoint': '/',
35+ 'pool_properties': {'ashift': 42},
36+ 'fs_properties': {'compression': 'lz4'}}
37 disk_path = "/wark/mydev"
38 m_getpath.return_value = disk_path
39 m_block.disk_to_byid_path.return_value = None
40 m_util.load_command_environment.return_value = {'target': 'mytarget'}
41 block_meta.zpool_handler(info, storage_config)
42- m_zfs.zpool_create.assert_called_with(info['pool'], [disk_path],
43- mountpoint="/",
44- altroot="mytarget")
45+ m_zfs.zpool_create.assert_called_with(
46+ info['pool'], [disk_path],
47+ mountpoint="/",
48+ altroot="mytarget",
49+ pool_properties={'ashift': 42},
50+ zfs_properties={'compression': 'lz4'})
51
52
53 class TestZFSRootUpdates(CiTestCase):

Subscribers

People subscribed via source and target branches