Merge ~dbungert/curtin:get-resize-fstypes into curtin:master

Proposed by Dan Bungert
Status: Merged
Approved by: Michael Hudson-Doyle
Approved revision: 10eef3d092a065d985bc39f20799ce76849a1178
Merge reported by: Server Team CI bot
Merged at revision: not available
Proposed branch: ~dbungert/curtin:get-resize-fstypes
Merge into: curtin:master
Diff against target: 31 lines (+13/-0)
2 files modified
curtin/block/__init__.py (+5/-0)
tests/unittests/test_block.py (+8/-0)
Reviewer Review Type Date Requested Status
Michael Hudson-Doyle Approve
Server Team CI bot continuous-integration Approve
Review via email: mp+419517@code.launchpad.net

Commit message

block: provide get_resize_fstypes

So callers can know which fs types we can and can't resize.

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
Michael Hudson-Doyle (mwhudson) wrote :

Simple enough!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/curtin/block/__init__.py b/curtin/block/__init__.py
2index f37ebee..49b062f 100644
3--- a/curtin/block/__init__.py
4+++ b/curtin/block/__init__.py
5@@ -1368,4 +1368,9 @@ def discover():
6 return {}
7
8
9+def get_resize_fstypes():
10+ from curtin.commands.block_meta_v2 import resizers
11+ return {fstype for fstype in resizers.keys()}
12+
13+
14 # vi: ts=4 expandtab syntax=python
15diff --git a/tests/unittests/test_block.py b/tests/unittests/test_block.py
16index 6d9b776..7a73b69 100644
17--- a/tests/unittests/test_block.py
18+++ b/tests/unittests/test_block.py
19@@ -927,4 +927,12 @@ class TestSfdiskInfo(CiTestCase):
20 self.assertEqual([], self.m_load_json.call_args_list)
21
22
23+class TestResize(CiTestCase):
24+ def test_basic(self):
25+ resizers = 'curtin.commands.block_meta_v2.resizers'
26+ values = {'a': 1, 'b': 2}
27+ with mock.patch.dict(resizers, values, clear=True):
28+ self.assertEqual({'a', 'b'}, block.get_resize_fstypes())
29+
30+
31 # vi: ts=4 expandtab syntax=python

Subscribers

People subscribed via source and target branches