We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent dacabae commit 52ba840Copy full SHA for 52ba840
lib/vm.py
@@ -1,5 +1,7 @@
1
from __future__ import annotations
2
3
+import pytest
4
+
5
import logging
6
import os
7
import tempfile
@@ -345,6 +347,14 @@ def destroy_vdi(self, vdi_uuid: str) -> None:
345
347
super().destroy_vdi(vdi_uuid)
346
348
break
349
350
+ def destroy_vdi_by_name(self, name: str) -> None:
351
+ for vdi in self.vdis:
352
+ if vdi.name() == name:
353
+ self.vdis.remove(vdi)
354
+ super().destroy_vdi(vdi.uuid)
355
+ return
356
+ raise pytest.fail(f"No VDI named '{name}' in vm {self.uuid}")
357
358
def create_vdis_list(self) -> None:
359
""" Used to redo the VDIs list of the VM when reverting a snapshot. """
360
try:
0 commit comments