Skip to content

Commit a47e4a5

Browse files
chore(baremetal): remove lvm from partitioning (scaleway#675)
Co-authored-by: Jonathan R. <[email protected]>
1 parent 90e54b7 commit a47e4a5

File tree

6 files changed

+0
-400
lines changed

6 files changed

+0
-400
lines changed

scaleway-async/scaleway_async/baremetal/v1/__init__.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
from .types import OfferStock
1010
from .types import OfferSubscriptionPeriod
1111
from .types import SchemaFilesystemFormat
12-
from .types import SchemaLogicalVolumeType
1312
from .types import SchemaPartitionLabel
1413
from .types import SchemaPoolType
1514
from .types import SchemaRAIDLevel
@@ -23,13 +22,10 @@
2322
from .types import ServerStatus
2423
from .content import SERVER_TRANSIENT_STATUSES
2524
from .types import SettingType
26-
from .types import SchemaLogicalVolume
2725
from .types import SchemaPartition
28-
from .types import SchemaVolumeGroup
2926
from .types import SchemaPool
3027
from .types import SchemaDisk
3128
from .types import SchemaFilesystem
32-
from .types import SchemaLVM
3329
from .types import SchemaRAID
3430
from .types import SchemaZFS
3531
from .types import CertificationOption
@@ -111,7 +107,6 @@
111107
"OfferStock",
112108
"OfferSubscriptionPeriod",
113109
"SchemaFilesystemFormat",
114-
"SchemaLogicalVolumeType",
115110
"SchemaPartitionLabel",
116111
"SchemaPoolType",
117112
"SchemaRAIDLevel",
@@ -125,13 +120,10 @@
125120
"ServerStatus",
126121
"SERVER_TRANSIENT_STATUSES",
127122
"SettingType",
128-
"SchemaLogicalVolume",
129123
"SchemaPartition",
130-
"SchemaVolumeGroup",
131124
"SchemaPool",
132125
"SchemaDisk",
133126
"SchemaFilesystem",
134-
"SchemaLVM",
135127
"SchemaRAID",
136128
"SchemaZFS",
137129
"CertificationOption",

scaleway-async/scaleway_async/baremetal/v1/marshalling.py

Lines changed: 0 additions & 148 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,10 @@
1414
resolve_one_of,
1515
)
1616
from .types import (
17-
SchemaLogicalVolume,
1817
SchemaPartition,
19-
SchemaVolumeGroup,
2018
SchemaPool,
2119
SchemaDisk,
2220
SchemaFilesystem,
23-
SchemaLVM,
2421
SchemaRAID,
2522
SchemaZFS,
2623
Schema,
@@ -73,37 +70,6 @@
7370
)
7471

7572

76-
def unmarshal_SchemaLogicalVolume(data: Any) -> SchemaLogicalVolume:
77-
if not isinstance(data, dict):
78-
raise TypeError(
79-
"Unmarshalling the type 'SchemaLogicalVolume' failed as data isn't a dictionary."
80-
)
81-
82-
args: Dict[str, Any] = {}
83-
84-
field = data.get("name", None)
85-
if field is not None:
86-
args["name"] = field
87-
88-
field = data.get("type", None)
89-
if field is not None:
90-
args["type_"] = field
91-
92-
field = data.get("size", None)
93-
if field is not None:
94-
args["size"] = field
95-
96-
field = data.get("striped_number", None)
97-
if field is not None:
98-
args["striped_number"] = field
99-
100-
field = data.get("mirror_number", None)
101-
if field is not None:
102-
args["mirror_number"] = field
103-
104-
return SchemaLogicalVolume(**args)
105-
106-
10773
def unmarshal_SchemaPartition(data: Any) -> SchemaPartition:
10874
if not isinstance(data, dict):
10975
raise TypeError(
@@ -127,33 +93,6 @@ def unmarshal_SchemaPartition(data: Any) -> SchemaPartition:
12793
return SchemaPartition(**args)
12894

12995

130-
def unmarshal_SchemaVolumeGroup(data: Any) -> SchemaVolumeGroup:
131-
if not isinstance(data, dict):
132-
raise TypeError(
133-
"Unmarshalling the type 'SchemaVolumeGroup' failed as data isn't a dictionary."
134-
)
135-
136-
args: Dict[str, Any] = {}
137-
138-
field = data.get("volume_group_name", None)
139-
if field is not None:
140-
args["volume_group_name"] = field
141-
142-
field = data.get("physical_volumes", None)
143-
if field is not None:
144-
args["physical_volumes"] = field
145-
146-
field = data.get("logical_volumes", None)
147-
if field is not None:
148-
args["logical_volumes"] = (
149-
[unmarshal_SchemaLogicalVolume(v) for v in field]
150-
if field is not None
151-
else None
152-
)
153-
154-
return SchemaVolumeGroup(**args)
155-
156-
15796
def unmarshal_SchemaPool(data: Any) -> SchemaPool:
15897
if not isinstance(data, dict):
15998
raise TypeError(
@@ -229,25 +168,6 @@ def unmarshal_SchemaFilesystem(data: Any) -> SchemaFilesystem:
229168
return SchemaFilesystem(**args)
230169

231170

232-
def unmarshal_SchemaLVM(data: Any) -> SchemaLVM:
233-
if not isinstance(data, dict):
234-
raise TypeError(
235-
"Unmarshalling the type 'SchemaLVM' failed as data isn't a dictionary."
236-
)
237-
238-
args: Dict[str, Any] = {}
239-
240-
field = data.get("volume_groups", None)
241-
if field is not None:
242-
args["volume_groups"] = (
243-
[unmarshal_SchemaVolumeGroup(v) for v in field]
244-
if field is not None
245-
else None
246-
)
247-
248-
return SchemaLVM(**args)
249-
250-
251171
def unmarshal_SchemaRAID(data: Any) -> SchemaRAID:
252172
if not isinstance(data, dict):
253173
raise TypeError(
@@ -316,12 +236,6 @@ def unmarshal_Schema(data: Any) -> Schema:
316236
else None
317237
)
318238

319-
field = data.get("lvm", None)
320-
if field is not None:
321-
args["lvm"] = unmarshal_SchemaLVM(field)
322-
else:
323-
args["lvm"] = None
324-
325239
field = data.get("zfs", None)
326240
if field is not None:
327241
args["zfs"] = unmarshal_SchemaZFS(field)
@@ -1653,30 +1567,6 @@ def marshal_UpdateSettingRequest(
16531567
return output
16541568

16551569

1656-
def marshal_SchemaLogicalVolume(
1657-
request: SchemaLogicalVolume,
1658-
defaults: ProfileDefaults,
1659-
) -> Dict[str, Any]:
1660-
output: Dict[str, Any] = {}
1661-
1662-
if request.name is not None:
1663-
output["name"] = request.name
1664-
1665-
if request.type_ is not None:
1666-
output["type"] = str(request.type_)
1667-
1668-
if request.size is not None:
1669-
output["size"] = request.size
1670-
1671-
if request.striped_number is not None:
1672-
output["striped_number"] = request.striped_number
1673-
1674-
if request.mirror_number is not None:
1675-
output["mirror_number"] = request.mirror_number
1676-
1677-
return output
1678-
1679-
16801570
def marshal_SchemaPartition(
16811571
request: SchemaPartition,
16821572
defaults: ProfileDefaults,
@@ -1695,27 +1585,6 @@ def marshal_SchemaPartition(
16951585
return output
16961586

16971587

1698-
def marshal_SchemaVolumeGroup(
1699-
request: SchemaVolumeGroup,
1700-
defaults: ProfileDefaults,
1701-
) -> Dict[str, Any]:
1702-
output: Dict[str, Any] = {}
1703-
1704-
if request.volume_group_name is not None:
1705-
output["volume_group_name"] = request.volume_group_name
1706-
1707-
if request.physical_volumes is not None:
1708-
output["physical_volumes"] = request.physical_volumes
1709-
1710-
if request.logical_volumes is not None:
1711-
output["logical_volumes"] = [
1712-
marshal_SchemaLogicalVolume(item, defaults)
1713-
for item in request.logical_volumes
1714-
]
1715-
1716-
return output
1717-
1718-
17191588
def marshal_SchemaPool(
17201589
request: SchemaPool,
17211590
defaults: ProfileDefaults,
@@ -1775,20 +1644,6 @@ def marshal_SchemaFilesystem(
17751644
return output
17761645

17771646

1778-
def marshal_SchemaLVM(
1779-
request: SchemaLVM,
1780-
defaults: ProfileDefaults,
1781-
) -> Dict[str, Any]:
1782-
output: Dict[str, Any] = {}
1783-
1784-
if request.volume_groups is not None:
1785-
output["volume_groups"] = [
1786-
marshal_SchemaVolumeGroup(item, defaults) for item in request.volume_groups
1787-
]
1788-
1789-
return output
1790-
1791-
17921647
def marshal_SchemaRAID(
17931648
request: SchemaRAID,
17941649
defaults: ProfileDefaults,
@@ -1836,9 +1691,6 @@ def marshal_Schema(
18361691
marshal_SchemaFilesystem(item, defaults) for item in request.filesystems
18371692
]
18381693

1839-
if request.lvm is not None:
1840-
output["lvm"] = marshal_SchemaLVM(request.lvm, defaults)
1841-
18421694
if request.zfs is not None:
18431695
output["zfs"] = marshal_SchemaZFS(request.zfs, defaults)
18441696

scaleway-async/scaleway_async/baremetal/v1/types.py

Lines changed: 0 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -98,20 +98,6 @@ def __str__(self) -> str:
9898
return str(self.value)
9999

100100

101-
class SchemaLogicalVolumeType(str, Enum, metaclass=StrEnumMeta):
102-
UNKNOWN_RAID_TYPE = "unknown_raid_type"
103-
STRIPED = "striped"
104-
MIRROR = "mirror"
105-
RAID0 = "raid0"
106-
RAID1 = "raid1"
107-
RAID5 = "raid5"
108-
RAID6 = "raid6"
109-
RAID10 = "raid10"
110-
111-
def __str__(self) -> str:
112-
return str(self.value)
113-
114-
115101
class SchemaPartitionLabel(str, Enum, metaclass=StrEnumMeta):
116102
UNKNOWN_PARTITION_LABEL = "unknown_partition_label"
117103
UEFI = "uefi"
@@ -122,7 +108,6 @@ class SchemaPartitionLabel(str, Enum, metaclass=StrEnumMeta):
122108
DATA = "data"
123109
HOME = "home"
124110
RAID = "raid"
125-
LVM = "lvm"
126111
ZFS = "zfs"
127112

128113
def __str__(self) -> str:
@@ -230,19 +215,6 @@ def __str__(self) -> str:
230215
return str(self.value)
231216

232217

233-
@dataclass
234-
class SchemaLogicalVolume:
235-
name: str
236-
237-
type_: SchemaLogicalVolumeType
238-
239-
size: int
240-
241-
striped_number: int
242-
243-
mirror_number: int
244-
245-
246218
@dataclass
247219
class SchemaPartition:
248220
label: SchemaPartitionLabel
@@ -252,15 +224,6 @@ class SchemaPartition:
252224
size: int
253225

254226

255-
@dataclass
256-
class SchemaVolumeGroup:
257-
volume_group_name: str
258-
259-
physical_volumes: List[str]
260-
261-
logical_volumes: List[SchemaLogicalVolume]
262-
263-
264227
@dataclass
265228
class SchemaPool:
266229
name: str
@@ -290,11 +253,6 @@ class SchemaFilesystem:
290253
mountpoint: str
291254

292255

293-
@dataclass
294-
class SchemaLVM:
295-
volume_groups: List[SchemaVolumeGroup]
296-
297-
298256
@dataclass
299257
class SchemaRAID:
300258
name: str
@@ -342,8 +300,6 @@ class Schema:
342300

343301
filesystems: List[SchemaFilesystem]
344302

345-
lvm: Optional[SchemaLVM]
346-
347303
zfs: Optional[SchemaZFS]
348304

349305

scaleway/scaleway/baremetal/v1/__init__.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
from .types import OfferStock
1010
from .types import OfferSubscriptionPeriod
1111
from .types import SchemaFilesystemFormat
12-
from .types import SchemaLogicalVolumeType
1312
from .types import SchemaPartitionLabel
1413
from .types import SchemaPoolType
1514
from .types import SchemaRAIDLevel
@@ -23,13 +22,10 @@
2322
from .types import ServerStatus
2423
from .content import SERVER_TRANSIENT_STATUSES
2524
from .types import SettingType
26-
from .types import SchemaLogicalVolume
2725
from .types import SchemaPartition
28-
from .types import SchemaVolumeGroup
2926
from .types import SchemaPool
3027
from .types import SchemaDisk
3128
from .types import SchemaFilesystem
32-
from .types import SchemaLVM
3329
from .types import SchemaRAID
3430
from .types import SchemaZFS
3531
from .types import CertificationOption
@@ -111,7 +107,6 @@
111107
"OfferStock",
112108
"OfferSubscriptionPeriod",
113109
"SchemaFilesystemFormat",
114-
"SchemaLogicalVolumeType",
115110
"SchemaPartitionLabel",
116111
"SchemaPoolType",
117112
"SchemaRAIDLevel",
@@ -125,13 +120,10 @@
125120
"ServerStatus",
126121
"SERVER_TRANSIENT_STATUSES",
127122
"SettingType",
128-
"SchemaLogicalVolume",
129123
"SchemaPartition",
130-
"SchemaVolumeGroup",
131124
"SchemaPool",
132125
"SchemaDisk",
133126
"SchemaFilesystem",
134-
"SchemaLVM",
135127
"SchemaRAID",
136128
"SchemaZFS",
137129
"CertificationOption",

0 commit comments

Comments
 (0)