mirror of
https://github.com/ComputerScienceHouse/proxstar.git
synced 2025-03-09 15:40:09 +00:00
Create method to get a vm's cd-roms
Create a method to get the drives attached to a vm that have media type cdrom.
This commit is contained in:
parent
2f0b113b05
commit
27a6b2136e
1 changed files with 11 additions and 0 deletions
|
@ -202,6 +202,17 @@ class VM:
|
||||||
disks = sorted(disks, key=lambda x: x[0])
|
disks = sorted(disks, key=lambda x: x[0])
|
||||||
return disks
|
return disks
|
||||||
|
|
||||||
|
@lazy_property
|
||||||
|
def cdroms(self):
|
||||||
|
cdroms = []
|
||||||
|
valid_cdrom_types = ['ide', 'sata', 'scsi']
|
||||||
|
for key, val in self.config.items():
|
||||||
|
if any(type in key for type in valid_cdrom_types):
|
||||||
|
if 'scsihw' not in key and 'cdrom' in val:
|
||||||
|
cdroms.append(key)
|
||||||
|
cdroms = sorted(cdroms)
|
||||||
|
return cdroms
|
||||||
|
|
||||||
@lazy_property
|
@lazy_property
|
||||||
def iso(self):
|
def iso(self):
|
||||||
if self.config.get('ide2'):
|
if self.config.get('ide2'):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue