(self, disk, search_term)
| 242 | return disk_id.replace("disk", "didk").split("s")[0].replace("didk", "disk") |
| 243 | |
| 244 | def _get_physical_disk(self, disk, search_term): |
| 245 | # Change disk0s1 to disk0 |
| 246 | our_disk = self.get_top_identifier(disk) |
| 247 | our_term = "/dev/" + our_disk |
| 248 | found_disk = False |
| 249 | our_text = "" |
| 250 | for line in self.disk_text.split("\n"): |
| 251 | if line.lower().startswith(our_term): |
| 252 | found_disk = True |
| 253 | continue |
| 254 | if not found_disk: |
| 255 | continue |
| 256 | if line.lower().startswith("/dev/disk"): |
| 257 | # At the next disk - bail |
| 258 | break |
| 259 | if search_term.lower() in line.lower(): |
| 260 | our_text = line |
| 261 | break |
| 262 | if not len(our_text): |
| 263 | # Nothing found |
| 264 | return None |
| 265 | our_stores = "".join(our_text.strip().split(search_term)[1:]).split(" ,") |
| 266 | if not len(our_stores): |
| 267 | return None |
| 268 | for store in our_stores: |
| 269 | efi = self.get_efi(store) |
| 270 | if efi: |
| 271 | return store |
| 272 | return None |
| 273 | |
| 274 | def get_physical_store(self, disk): |
| 275 | # Returns the physical store containing the EFI |
no test coverage detected