Skip to content

Commit b84ee9f

Browse files
fix(vm): Correct VDI UUID(s) extraction
Fixes #271 Signed-off-by: Rushikesh Jadhav <[email protected]>
1 parent b015d4a commit b84ee9f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/basevm.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,9 @@ def name(self):
4040

4141
def vdi_uuids(self, sr_uuid=None):
4242
output = self._disk_list()
43-
vdis = []
44-
for line in output.splitlines():
45-
vdis.append(line.split(',')[0])
43+
all_uuids = output.split(',') # Split based on commas
44+
# Select only every alternate UUID (even index positions)
45+
vdis = all_uuids[0::2] # Start at 0, step by 2
4646

4747
if sr_uuid is None:
4848
return vdis

0 commit comments

Comments
 (0)