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 a097f30 commit bb88e64Copy full SHA for bb88e64
proxstar/vm.py
@@ -251,6 +251,11 @@ def get_disk_size(self, name='virtio0'):
251
disk_size = split.split('=')[1].rstrip('G')
252
return disk_size
253
254
+ def check_in_gb(size):
255
+ if size[-1] == 'M':
256
+ size = f'{int(size.rstrip("M")) / 1000}G'
257
+ return size
258
+
259
@lazy_property
260
def disks(self):
261
disks = []
@@ -261,9 +266,7 @@ def disks(self):
266
disk_size = val.split(',')
262
267
for split in disk_size:
263
268
if 'size' in split:
264
- size = split.split('=')[1]
265
- if size[-1] == 'M':
- size = f'{int(size.rstrip("M")) / 1000}G'
269
+ size = check_in_gb(split.split('=')[1])
270
disk_size = size.rstrip('G')
271
disks.append([key, disk_size])
272
disks = sorted(disks, key=lambda x: x[0])
0 commit comments