File tree Expand file tree Collapse file tree 2 files changed +7
-6
lines changed Expand file tree Collapse file tree 2 files changed +7
-6
lines changed Original file line number Diff line number Diff line change 1+ from math import ceil
2+
13from proxmoxer .core import ResourceException
24from rq .registry import StartedJobRegistry
35
@@ -88,7 +90,7 @@ def usage(self):
8890 usage ['cpu' ] += int (vm .cpu )
8991 usage ['mem' ] += int (vm .mem ) / 1024
9092 for disk in vm .disks :
91- usage ['disk' ] += int (disk [1 ])
93+ usage ['disk' ] += int (ceil ( disk [1 ]) )
9294 return usage
9395
9496 @lazy_property
Original file line number Diff line number Diff line change 1010from proxstar .starrs import get_ip_for_mac
1111from proxstar .util import lazy_property , default_repr
1212
13+ def check_in_gb (size ):
14+ if size [- 1 ] == 'M' :
15+ size = f'{ int (size .rstrip ("M" )) / 1000 } G'
16+ return size
1317
1418@default_repr
1519class VM :
@@ -251,11 +255,6 @@ def get_disk_size(self, name='virtio0'):
251255 disk_size = split .split ('=' )[1 ].rstrip ('G' )
252256 return disk_size
253257
254- def check_in_gb (size ):
255- if size [- 1 ] == 'M' :
256- size = f'{ int (size .rstrip ("M" )) / 1000 } G'
257- return size
258-
259258 @lazy_property
260259 def disks (self ):
261260 disks = []
You can’t perform that action at this time.
0 commit comments