mirror of
https://github.com/retspen/webvirtcloud
synced 2024-12-25 15:45:23 +00:00
Fixed pep8
This commit is contained in:
parent
b9bf14fdb5
commit
56f840c893
13 changed files with 37 additions and 18 deletions
12
.travis.yml
Normal file
12
.travis.yml
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
language: python
|
||||||
|
python:
|
||||||
|
- "2.7"
|
||||||
|
env:
|
||||||
|
- DJANGO=1.7.7
|
||||||
|
install:
|
||||||
|
- pip install -r dev/requirements.txt --use-mirrors
|
||||||
|
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
|
||||||
|
- python manage.py migrate
|
||||||
|
- python manage.py test --settings=webvirtcloud.settings-dev
|
|
@ -1,9 +1,10 @@
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from django.db import models, migrations
|
from django.db import migrations
|
||||||
from django.contrib.auth.models import User
|
from django.contrib.auth.models import User
|
||||||
|
|
||||||
|
|
||||||
def add_admin(apps, schema_editor):
|
def add_admin(apps, schema_editor):
|
||||||
add_user = User.objects.create_user("admin", None, "admin")
|
add_user = User.objects.create_user("admin", None, "admin")
|
||||||
add_user.is_active = True
|
add_user.is_active = True
|
||||||
|
@ -11,6 +12,7 @@ def add_admin(apps, schema_editor):
|
||||||
add_user.is_staff = True
|
add_user.is_staff = True
|
||||||
add_user.save()
|
add_user.save()
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
dependencies = [
|
dependencies = [
|
||||||
|
|
|
@ -1,7 +1,8 @@
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from django.db import models, migrations
|
from django.db import migrations
|
||||||
|
|
||||||
|
|
||||||
def add_favors(apps, schema_editor):
|
def add_favors(apps, schema_editor):
|
||||||
Flavor = apps.get_model("create", "Flavor")
|
Flavor = apps.get_model("create", "Flavor")
|
||||||
|
@ -18,6 +19,7 @@ def add_favors(apps, schema_editor):
|
||||||
add_flavor = Flavor(label="xlarge", vcpu="8", memory="16384", disk="160")
|
add_flavor = Flavor(label="xlarge", vcpu="8", memory="16384", disk="160")
|
||||||
add_flavor.save()
|
add_flavor.save()
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
dependencies = [
|
dependencies = [
|
||||||
|
|
|
@ -1,2 +1,5 @@
|
||||||
Django==1.7.7
|
Django==1.7.7
|
||||||
websockify==0.6.0
|
websockify==0.6.0
|
||||||
|
pep8==1.6.2
|
||||||
|
pyflakes==0.8.1
|
||||||
|
pylint==1.4.3
|
|
@ -132,7 +132,7 @@ def storage(request, compute_id, pool):
|
||||||
if 'delete' in request.POST:
|
if 'delete' in request.POST:
|
||||||
try:
|
try:
|
||||||
conn.delete()
|
conn.delete()
|
||||||
return HttpResponseRedirect(reverse('storages', args=[host_id]))
|
return HttpResponseRedirect(reverse('storages', args=[compute_id]))
|
||||||
except libvirtError as lib_err:
|
except libvirtError as lib_err:
|
||||||
error_messages.append(lib_err.message)
|
error_messages.append(lib_err.message)
|
||||||
if 'set_autostart' in request.POST:
|
if 'set_autostart' in request.POST:
|
||||||
|
|
Loading…
Reference in a new issue