mirror of
https://github.com/ComputerScienceHouse/proxstar.git
synced 2025-02-14 14:01:51 +00:00
Fix Nesting
This commit is contained in:
parent
a097f30c6b
commit
bb88e64aad
1 changed files with 6 additions and 3 deletions
|
@ -251,6 +251,11 @@ class VM:
|
||||||
disk_size = split.split('=')[1].rstrip('G')
|
disk_size = split.split('=')[1].rstrip('G')
|
||||||
return disk_size
|
return disk_size
|
||||||
|
|
||||||
|
def check_in_gb(size):
|
||||||
|
if size[-1] == 'M':
|
||||||
|
size = f'{int(size.rstrip("M")) / 1000}G'
|
||||||
|
return size
|
||||||
|
|
||||||
@lazy_property
|
@lazy_property
|
||||||
def disks(self):
|
def disks(self):
|
||||||
disks = []
|
disks = []
|
||||||
|
@ -261,9 +266,7 @@ class VM:
|
||||||
disk_size = val.split(',')
|
disk_size = val.split(',')
|
||||||
for split in disk_size:
|
for split in disk_size:
|
||||||
if 'size' in split:
|
if 'size' in split:
|
||||||
size = split.split('=')[1]
|
size = check_in_gb(split.split('=')[1])
|
||||||
if size[-1] == 'M':
|
|
||||||
size = f'{int(size.rstrip("M")) / 1000}G'
|
|
||||||
disk_size = size.rstrip('G')
|
disk_size = size.rstrip('G')
|
||||||
disks.append([key, disk_size])
|
disks.append([key, disk_size])
|
||||||
disks = sorted(disks, key=lambda x: x[0])
|
disks = sorted(disks, key=lambda x: x[0])
|
||||||
|
|
Loading…
Reference in a new issue