diff --git a/.travis.yml b/.travis.yml index 49a0b13..131aa6d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,14 +2,14 @@ language: python python: - "2.7" env: - - DJANGO=1.11.21 + - DJANGO=1.11.23 install: - pip install -r dev/requirements.txt script: - pep8 --exclude=IPy.py --ignore=E501 vrtManager accounts computes \ - console create instances interfaces \ - networks secrets storages - - pyflakes vrtManager accounts computes console create instances interfaces \ - networks secrets storages + console create datasource instances interfaces \ + logs networks nwfilters secrets storages + - pyflakes vrtManager accounts computes console create datasource instances interfaces \ + nwfilters networks secrets storages logs - python manage.py migrate - python manage.py test --settings=webvirtcloud.settings-dev diff --git a/conf/requirements.txt b/conf/requirements.txt index fd3071b..28ca300 100644 --- a/conf/requirements.txt +++ b/conf/requirements.txt @@ -1,5 +1,5 @@ -Django==1.11.23 -websockify==0.8.0 +Django==1.11.25 +websockify==0.9.0 gunicorn==19.9.0 lxml==4.2.5 libvirt-python==5.3.0 diff --git a/instances/templates/add_instance_volume.html b/instances/templates/add_instance_volume.html index 779ba20..b242bcc 100644 --- a/instances/templates/add_instance_volume.html +++ b/instances/templates/add_instance_volume.html @@ -99,7 +99,7 @@ @@ -120,7 +120,7 @@
diff --git a/instances/views.py b/instances/views.py index 0ef489f..1a1c5c0 100644 --- a/instances/views.py +++ b/instances/views.py @@ -576,10 +576,14 @@ def instance(request, compute_id, vname): path = request.POST.get('path', '') name = request.POST.get('name', '') - conn.detach_disk(dev) - conn_delete.del_volume(name) - msg = _('Delete disk: ' + dev) + conn.detach_disk(dev) + try: + conn_delete.del_volume(name) + except libvirtError as err: + msg = _('The disk: ' + dev + ' is detached but not deleted. ' + err.message) + messages.warning(request, msg) + addlogmsg(request.user.username, instance.name, msg) return HttpResponseRedirect(request.get_full_path() + '#disks') diff --git a/storages/templates/storage.html b/storages/templates/storage.html index e7ddfe1..cf70f11 100644 --- a/storages/templates/storage.html +++ b/storages/templates/storage.html @@ -44,11 +44,12 @@
-

{% trans "Pool name" %}:

-

{% trans "Pool type" %}:

-

{% trans "Pool path" %}:

-

{% trans "Pool status" %}:

-

{% trans "Size" %}: ({{ size|filesizeformat }} / {{ used|filesizeformat }})

+

{% trans "Pool Name" %}:

+

{% trans "Pool Type" %}:

+

{% trans "Pool Path" %}:

+

{% trans "Pool Status" %}:

+

{% trans "Size" %}:

+

{% trans "Usage" %}({{ percent }}%):

{% trans "State" %}:

{% trans "Autostart" %}:

@@ -57,7 +58,8 @@

{% if not type %}{% trans "None" %}{% else %}{{ type }}{% endif %}

{% if not path %}{% trans "None" %}{% else %}{{ path }}{% endif %}

{% if not status %}{% trans "None" %}{% else %}{{ status }}{% endif %}

-

{% trans "Usage" %}: {{ percent }}%

+

{{ size|filesizeformat }}

+

{{ used|filesizeformat }}

{% csrf_token %} {% ifequal state 0 %} diff --git a/templates/404.html b/templates/404.html index fa98e50..56f4f3d 100644 --- a/templates/404.html +++ b/templates/404.html @@ -4,12 +4,12 @@ {% block content %}
-

Oops!

+

{% trans 'Oops!'%}

{% trans "404 Not Found" %}

{% trans "The requested page was not found on this server." %}

- ← Back + ← {% trans 'Back'%}
{% endblock %} diff --git a/templates/500.html b/templates/500.html index b8dcfa4..3908922 100644 --- a/templates/500.html +++ b/templates/500.html @@ -4,12 +4,12 @@ {% block content %}
-

Oops!

+

{% trans 'Oops!' %}

{% trans "500 Internal Server Error" %}

{% trans "The server encountered an internal error or misconfiguration and was unable to complete you request." %}

- ← Back + ← {% trans 'Back'%}
{% endblock %} diff --git a/templates/base.html b/templates/base.html index 4959bb5..f0d67c5 100644 --- a/templates/base.html +++ b/templates/base.html @@ -5,7 +5,7 @@ - + {% block title %}{% endblock %} diff --git a/templates/errors_block.html b/templates/errors_block.html index 5c9c5fd..ed2f6da 100644 --- a/templates/errors_block.html +++ b/templates/errors_block.html @@ -1,3 +1,4 @@ +{% load i18n %} {% if error_messages %} {% for error in error_messages %} @@ -5,7 +6,7 @@
- Error: {{ error }} + {% trans 'Error' %}: {{ error }}
diff --git a/templates/messages_block.html b/templates/messages_block.html index cb2aef6..3961ac3 100644 --- a/templates/messages_block.html +++ b/templates/messages_block.html @@ -1,3 +1,4 @@ +{% load i18n %} {% if messages %} {% for message in messages %} @@ -5,7 +6,7 @@
- Success: {{ message }} + {% trans 'Success' %}: {{ message }}
diff --git a/vrtManager/instance.py b/vrtManager/instance.py index 6c1cfec..eb4147f 100644 --- a/vrtManager/instance.py +++ b/vrtManager/instance.py @@ -528,8 +528,8 @@ class wvmInstance(wvmConnect): mem_usage = {} if self.get_status() == 1: mem_stats = self.instance.memoryStats() - rss = mem_stats['rss'] if mem_stats['rss'] else 0 - total = mem_stats['actual'] if mem_stats['actual'] else 0 + rss = mem_stats['rss'] if 'rss' in mem_stats else 0 + total = mem_stats['actual'] if 'actual' in mem_stats else 0 available = total - rss if available < 0: available = 0