fixing errors on vm creation

This commit is contained in:
Levi 2017-05-06 18:17:47 -05:00
parent 3994d2d33b
commit 767a5fc5da

View file

@ -88,7 +88,7 @@ class HostingManageVMAdmin(admin.ModelAdmin):
return TemplateResponse(request, "hosting/managevms.html", context)
def create_vm_view(self, specs):
vm_id = None
try:
# We do have the vm_template param set. Get and parse it
# and check it to be in the desired range.
@ -107,11 +107,11 @@ class HostingManageVMAdmin(admin.ModelAdmin):
vm_id = oca.VirtualMachine.allocate(
self.client,
vm_string_formatter.format(
memory=specs.get('memory'),
memory=1024 * specs.get('memory'),
vcpu=specs.get('cores'),
cpu=0.1 * specs.get('cores'),
disk_type='fs',
size=specs.get('disk_size')
size=10000 * specs.get('disk_size')
)
)
# message = _("Created with id = " + str(vm_id))