(cls, arg: _LvmVolumeGroupSerialization, disk_config: DiskLayoutConfiguration)
| 1108 | |
| 1109 | @classmethod |
| 1110 | def parse_arg(cls, arg: _LvmVolumeGroupSerialization, disk_config: DiskLayoutConfiguration) -> Self: |
| 1111 | lvm_pvs = [] |
| 1112 | for mod in disk_config.device_modifications: |
| 1113 | for part in mod.partitions: |
| 1114 | if part.obj_id in arg.get('lvm_pvs', []): |
| 1115 | lvm_pvs.append(part) |
| 1116 | |
| 1117 | return cls( |
| 1118 | arg['name'], |
| 1119 | lvm_pvs, |
| 1120 | [LvmVolume.parse_arg(vol) for vol in arg['volumes']], |
| 1121 | ) |
| 1122 | |
| 1123 | def contains_lv(self, lv: LvmVolume) -> bool: |
| 1124 | return lv in self.volumes |