Skip to content

Commit 1e26405

Browse files
committed
Fix ISO eject
Fixes #345 Signed-off-by: Justin Cinkelj <justin.cinkelj@xlab.si>
1 parent 7e80872 commit 1e26405

File tree

1 file changed

+12
-0
lines changed
  • plugins/module_utils

1 file changed

+12
-0
lines changed

plugins/module_utils/vm.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1569,6 +1569,18 @@ def ensure_present_or_set(cls, module, rest_client, module_path, vm_before: VM):
15691569
module, rest_client, iso, uuid, attach=True
15701570
)
15711571
changed = True
1572+
else:
1573+
# Empty CD-ROM is requested. Detach ISO if needed.
1574+
if ansible_existing_disk:
1575+
name = ansible_existing_disk["iso_name"] #
1576+
existing_iso = ISO.get_by_name(
1577+
dict(name=name), rest_client, must_exist=False
1578+
)
1579+
if existing_iso:
1580+
cls.iso_image_management(
1581+
module, rest_client, existing_iso, uuid, attach=False
1582+
)
1583+
changed = True
15721584
else:
15731585
if ansible_existing_disk:
15741586
existing_disk = Disk.from_ansible(ansible_existing_disk)

0 commit comments

Comments
 (0)