diff --git a/hosting/opennebula_functions.py b/hosting/opennebula_functions.py index d9421d48..d2796ec8 100644 --- a/hosting/opennebula_functions.py +++ b/hosting/opennebula_functions.py @@ -174,9 +174,6 @@ class OpenNebulaManager: def get_vm_templates(self): template_pool = oca.VmTemplatePool(self.oneadmin_client) template_pool.info() - a = template_pool[0] - import pdb - pdb.set_trace() return template_pool def get_vm(self, email, vm_id): @@ -206,9 +203,6 @@ class OpenNebulaManager: return vm_pool - - - class HostingManageVMAdmin(admin.ModelAdmin): client = None oneadmin_client = None diff --git a/hosting/templates/hosting/virtual_machine_detail.html b/hosting/templates/hosting/virtual_machine_detail.html index e0909b24..06e5a53c 100644 --- a/hosting/templates/hosting/virtual_machine_detail.html +++ b/hosting/templates/hosting/virtual_machine_detail.html @@ -85,7 +85,7 @@
{% trans "Disk"%}
- {{virtual_machine.disk_size}} GiB + {{virtual_machine.disk_size|floatformat:2}} GiB
@@ -150,14 +150,15 @@

{% trans "Current status"%}

+
- {% if virtual_machine.status == 'pending' %} - {{virtual_machine.get_status_display}} - {% elif virtual_machine.status == 'online' %} - {{virtual_machine.get_status_display}} - {% elif virtual_machine.status == 'canceled'%} - {{virtual_machine.get_status_display}} - {% endif %} + {% if virtual_machine.state == 'ACTIVE' %} + {{virtual_machine.state}} + {% elif virtual_machine.state == 'POWEROFF' %} + {{virtual_machine.state}} + {% else %} + {{virtual_machine.state}} + {% endif %}
diff --git a/hosting/templates/hosting/virtual_machines.html b/hosting/templates/hosting/virtual_machines.html index 2de8aa48..431dcb82 100644 --- a/hosting/templates/hosting/virtual_machines.html +++ b/hosting/templates/hosting/virtual_machines.html @@ -22,8 +22,8 @@ {% for vm in vms_opennebula %} - {{vm.deploy_id}} - {{vm.price}} CHF + {{vm.name}} + {{vm.price|floatformat:2}} CHF {% if vm.state == 'ACTIVE' %}