1
0
Fork 0
mirror of https://github.com/retspen/webvirtcloud synced 2024-11-01 03:54:15 +00:00

vrtManager/instance.py: get_media_device fix: media.xpath returns list

This commit is contained in:
Ing. Jan KRCMAR 2018-08-02 10:47:13 +02:00
parent 951498e841
commit 3b99c983d5

View file

@ -274,9 +274,9 @@ class wvmInstance(wvmConnect):
device = media.xpath('@device')[0] device = media.xpath('@device')[0]
if device == 'cdrom': if device == 'cdrom':
try: try:
dev = media.xpath('target/@dev') dev = media.xpath('target/@dev')[0]
try: try:
src_fl = media.xpath('source/@file') src_fl = media.xpath('source/@file')[0]
vol = self.get_volume_by_path(src_fl) vol = self.get_volume_by_path(src_fl)
volume = vol.name() volume = vol.name()
stg = vol.storagePoolLookupByVolume() stg = vol.storagePoolLookupByVolume()