Merge pull request #1366 from mwhudson/lp-1982903
add .path to Raid so for_client(raid-with-partitions) works
This commit is contained in:
commit
57fb6b8072
|
@ -18,12 +18,14 @@ import unittest
|
|||
|
||||
from subiquity.common.filesystem.labels import (
|
||||
annotations,
|
||||
for_client,
|
||||
usage_labels,
|
||||
)
|
||||
from subiquity.models.tests.test_filesystem import (
|
||||
make_model,
|
||||
make_model_and_disk,
|
||||
make_model_and_partition,
|
||||
make_model_and_raid,
|
||||
make_partition,
|
||||
)
|
||||
|
||||
|
@ -123,3 +125,11 @@ class TestUsageLabels(unittest.TestCase):
|
|||
self.assertEqual(
|
||||
usage_labels(partition),
|
||||
["to be reformatted as ext4", "mounted at /"])
|
||||
|
||||
|
||||
class TestForClient(unittest.TestCase):
|
||||
|
||||
def test_for_client_raid_parts(self):
|
||||
model, raid = make_model_and_raid()
|
||||
make_partition(model, raid)
|
||||
for_client(raid)
|
||||
|
|
|
@ -799,6 +799,12 @@ class Raid(_Device):
|
|||
container = attributes.ref(backlink="_subvolumes", default=None) # Raid
|
||||
_subvolumes = attributes.backlink(default=attr.Factory(list))
|
||||
|
||||
@property
|
||||
def path(self):
|
||||
# This is just here to make for_client(raid-with-partitions) work. It
|
||||
# might not be very accurate.
|
||||
return '/dev/md/' + self.name
|
||||
|
||||
@property
|
||||
def size(self):
|
||||
if self.preserve and self._m._probe_data:
|
||||
|
|
Loading…
Reference in New Issue