From 1ff4e058192b8a56299914c65e8cf801285a7b6a Mon Sep 17 00:00:00 2001 From: Marc Aymerich Date: Sat, 4 Apr 2015 18:10:39 +0000 Subject: [PATCH] flake8 --- orchestra/admin/actions.py | 1 - orchestra/api/helpers.py | 1 - orchestra/api/options.py | 3 +-- orchestra/apps/accounts/admin.py | 2 -- orchestra/apps/contacts/admin.py | 4 ++-- orchestra/apps/databases/admin.py | 5 ++--- orchestra/apps/databases/backends.py | 6 ------ orchestra/apps/databases/serializers.py | 2 +- .../databases/tests/functional_tests/tests.py | 4 ---- orchestra/apps/domains/backends.py | 1 - orchestra/apps/domains/helpers.py | 1 - orchestra/apps/lists/admin.py | 2 +- orchestra/apps/lists/backends.py | 2 -- orchestra/apps/lists/serializers.py | 2 +- .../apps/lists/tests/functional_tests/tests.py | 7 +------ orchestra/apps/mailboxes/admin.py | 4 +--- orchestra/apps/mailboxes/backends.py | 3 --- orchestra/apps/mailboxes/forms.py | 2 +- orchestra/apps/mailboxes/serializers.py | 2 +- .../mailboxes/tests/functional_tests/tests.py | 3 +-- orchestra/apps/orchestration/admin.py | 1 - orchestra/apps/orchestration/backends.py | 1 - .../management/commands/orchestrate.py | 1 - orchestra/apps/orchestration/middlewares.py | 2 +- orchestra/apps/orders/helpers.py | 1 - orchestra/apps/orders/models.py | 2 -- orchestra/apps/payments/methods/options.py | 2 -- .../apps/payments/methods/sepadirectdebit.py | 1 - orchestra/apps/plans/admin.py | 2 -- orchestra/apps/plans/models.py | 2 -- orchestra/apps/plans/rating.py | 2 +- orchestra/apps/resources/actions.py | 2 -- orchestra/apps/resources/admin.py | 1 - orchestra/apps/saas/fields.py | 2 -- orchestra/apps/saas/models.py | 1 - orchestra/apps/saas/services/gitlab.py | 1 - orchestra/apps/saas/services/moodle.py | 2 -- orchestra/apps/saas/services/options.py | 1 - orchestra/apps/saas/services/seafile.py | 1 - orchestra/apps/saas/services/wordpress.py | 1 - orchestra/apps/services/tests/test_handler.py | 3 +-- orchestra/apps/systemusers/actions.py | 7 ------- orchestra/apps/systemusers/admin.py | 13 +------------ orchestra/apps/systemusers/filters.py | 1 - orchestra/apps/systemusers/models.py | 1 - orchestra/apps/systemusers/serializers.py | 4 +--- orchestra/apps/systemusers/settings.py | 2 +- .../systemusers/tests/functional_tests/tests.py | 2 +- orchestra/apps/webapps/admin.py | 1 - orchestra/apps/webapps/fields.py | 2 -- orchestra/apps/webapps/models.py | 3 --- orchestra/apps/webapps/serializers.py | 2 -- orchestra/apps/webapps/settings.py | 1 - .../apps/webapps/tests/functional_tests/tests.py | 13 +------------ orchestra/apps/webapps/types/cms.py | 3 --- orchestra/apps/webapps/types/misc.py | 2 -- orchestra/apps/webapps/types/php.py | 1 - orchestra/apps/websites/admin.py | 1 - orchestra/apps/websites/models.py | 2 -- .../apps/websites/tests/functional_tests/tests.py | 15 ++------------- orchestra/plugins/options.py | 2 -- orchestra/utils/tests.py | 2 +- 62 files changed, 24 insertions(+), 145 deletions(-) diff --git a/orchestra/admin/actions.py b/orchestra/admin/actions.py index 19b756d8..cbae0579 100644 --- a/orchestra/admin/actions.py +++ b/orchestra/admin/actions.py @@ -5,7 +5,6 @@ from django.utils.translation import ungettext, ugettext_lazy as _ from .. import settings -from .utils import change_url from .forms import SendEmailForm diff --git a/orchestra/api/helpers.py b/orchestra/api/helpers.py index 6f6ccc9e..a364dec1 100644 --- a/orchestra/api/helpers.py +++ b/orchestra/api/helpers.py @@ -1,6 +1,5 @@ from django.core.urlresolvers import NoReverseMatch from rest_framework.reverse import reverse -from rest_framework.routers import replace_methodname def link_wrap(view, view_names): diff --git a/orchestra/api/options.py b/orchestra/api/options.py index 5df8187b..09960795 100644 --- a/orchestra/api/options.py +++ b/orchestra/api/options.py @@ -1,7 +1,6 @@ from django.conf import settings as django_settings -from django.core.exceptions import ImproperlyConfigured from django.utils.module_loading import autodiscover_modules -from rest_framework.routers import DefaultRouter, Route, replace_methodname +from rest_framework.routers import DefaultRouter from orchestra import settings from orchestra.utils.python import import_class diff --git a/orchestra/apps/accounts/admin.py b/orchestra/apps/accounts/admin.py index da5b87bd..0e67ffea 100644 --- a/orchestra/apps/accounts/admin.py +++ b/orchestra/apps/accounts/admin.py @@ -6,7 +6,6 @@ from django.conf.urls import patterns, url from django.contrib import admin, messages from django.contrib.admin.util import unquote from django.contrib.auth import admin as auth -from django.db.models.loading import get_model from django.http import HttpResponseRedirect from django.utils.safestring import mark_safe from django.utils.six.moves.urllib.parse import parse_qsl @@ -18,7 +17,6 @@ from orchestra.admin.utils import wrap_admin_view, admin_link, set_url_query, ch from orchestra.core import services, accounts from orchestra.forms import UserChangeForm -from . import settings from .actions import disable, list_contacts, service_report, delete_related_services from .filters import HasMainUserListFilter from .forms import AccountCreationForm diff --git a/orchestra/apps/contacts/admin.py b/orchestra/apps/contacts/admin.py index d5ea86f4..b23d10df 100644 --- a/orchestra/apps/contacts/admin.py +++ b/orchestra/apps/contacts/admin.py @@ -1,10 +1,10 @@ from django import forms from django.contrib import admin -from django.utils.translation import ugettext, ugettext_lazy as _ +from django.utils.translation import ugettext_lazy as _ from orchestra.admin import AtLeastOneRequiredInlineFormSet, ExtendedModelAdmin from orchestra.admin.actions import SendEmail -from orchestra.admin.utils import insertattr, admin_link, change_url +from orchestra.admin.utils import insertattr, change_url from orchestra.apps.accounts.admin import AccountAdmin, AccountAdminMixin from orchestra.forms.widgets import paddingCheckboxSelectMultiple diff --git a/orchestra/apps/databases/admin.py b/orchestra/apps/databases/admin.py index f2b6303d..9cc6727c 100644 --- a/orchestra/apps/databases/admin.py +++ b/orchestra/apps/databases/admin.py @@ -1,12 +1,11 @@ from django.conf.urls import patterns from django.contrib import admin from django.contrib.auth.admin import UserAdmin -from django.utils.safestring import mark_safe from django.utils.translation import ugettext_lazy as _ from orchestra.admin import ExtendedModelAdmin, ChangePasswordAdminMixin -from orchestra.admin.utils import admin_link, change_url -from orchestra.apps.accounts.admin import AccountAdminMixin, SelectAccountAdminMixin +from orchestra.admin.utils import change_url +from orchestra.apps.accounts.admin import SelectAccountAdminMixin from .forms import DatabaseCreationForm, DatabaseUserChangeForm, DatabaseUserCreationForm from .models import Database, DatabaseUser diff --git a/orchestra/apps/databases/backends.py b/orchestra/apps/databases/backends.py index 90bfe136..6c311383 100644 --- a/orchestra/apps/databases/backends.py +++ b/orchestra/apps/databases/backends.py @@ -128,12 +128,6 @@ class MysqlDisk(ServiceMonitor): # " | tail -n 1 # }""")) - def monitor(self, db): - if db.type != db.MYSQL: - return - context = self.get_context(db) - self.append("echo %(db_id)s $(monitor %(db_name)s)" % context) - def monitor(self, db): if db.type != db.MYSQL: return diff --git a/orchestra/apps/databases/serializers.py b/orchestra/apps/databases/serializers.py index 53c872f8..f191403f 100644 --- a/orchestra/apps/databases/serializers.py +++ b/orchestra/apps/databases/serializers.py @@ -1,6 +1,6 @@ from django.forms import widgets -from django.utils.translation import ugettext, ugettext_lazy as _ from django.shortcuts import get_object_or_404 +from django.utils.translation import ugettext_lazy as _ from rest_framework import serializers from orchestra.api.serializers import HyperlinkedModelSerializer diff --git a/orchestra/apps/databases/tests/functional_tests/tests.py b/orchestra/apps/databases/tests/functional_tests/tests.py index 4af3b0a8..b3f19afd 100644 --- a/orchestra/apps/databases/tests/functional_tests/tests.py +++ b/orchestra/apps/databases/tests/functional_tests/tests.py @@ -2,17 +2,13 @@ import MySQLdb import os import socket import time -from functools import partial from django.conf import settings as djsettings from django.core.management.base import CommandError from django.core.urlresolvers import reverse -from selenium.webdriver.common.action_chains import ActionChains -from selenium.webdriver.common.keys import Keys from selenium.webdriver.support.select import Select from orchestra.admin.utils import change_url -from orchestra.apps.accounts.models import Account from orchestra.apps.orchestration.models import Server, Route from orchestra.utils.system import sshrun from orchestra.utils.tests import (BaseLiveServerTestCase, random_ascii, save_response_on_error, diff --git a/orchestra/apps/domains/backends.py b/orchestra/apps/domains/backends.py index 09186ede..45a6a9c8 100644 --- a/orchestra/apps/domains/backends.py +++ b/orchestra/apps/domains/backends.py @@ -5,7 +5,6 @@ from django.utils.translation import ugettext_lazy as _ from orchestra.apps.orchestration import ServiceController from orchestra.apps.orchestration.models import BackendOperation as Operation -from orchestra.utils.python import AttrDict from . import settings diff --git a/orchestra/apps/domains/helpers.py b/orchestra/apps/domains/helpers.py index ea36da5e..07b6e2c0 100644 --- a/orchestra/apps/domains/helpers.py +++ b/orchestra/apps/domains/helpers.py @@ -1,5 +1,4 @@ import copy -from functools import partial from .models import Domain, Record diff --git a/orchestra/apps/lists/admin.py b/orchestra/apps/lists/admin.py index 1f5594f4..4e8942cd 100644 --- a/orchestra/apps/lists/admin.py +++ b/orchestra/apps/lists/admin.py @@ -1,7 +1,7 @@ from django.contrib import admin from django.conf.urls import patterns from django.contrib.auth.admin import UserAdmin -from django.utils.translation import ugettext, ugettext_lazy as _ +from django.utils.translation import ugettext_lazy as _ from orchestra.admin import ExtendedModelAdmin, ChangePasswordAdminMixin from orchestra.admin.utils import admin_link diff --git a/orchestra/apps/lists/backends.py b/orchestra/apps/lists/backends.py index a166cda2..05092085 100644 --- a/orchestra/apps/lists/backends.py +++ b/orchestra/apps/lists/backends.py @@ -1,7 +1,5 @@ -import re import textwrap -from django.utils import timezone from django.utils.translation import ugettext_lazy as _ from orchestra.apps.orchestration import ServiceController diff --git a/orchestra/apps/lists/serializers.py b/orchestra/apps/lists/serializers.py index 1fd7a143..b3668660 100644 --- a/orchestra/apps/lists/serializers.py +++ b/orchestra/apps/lists/serializers.py @@ -1,5 +1,5 @@ from django.forms import widgets -from django.utils.translation import ugettext, ugettext_lazy as _ +from django.utils.translation import ugettext_lazy as _ from django.shortcuts import get_object_or_404 from rest_framework import serializers diff --git a/orchestra/apps/lists/tests/functional_tests/tests.py b/orchestra/apps/lists/tests/functional_tests/tests.py index 65fdc5b4..412e4403 100644 --- a/orchestra/apps/lists/tests/functional_tests/tests.py +++ b/orchestra/apps/lists/tests/functional_tests/tests.py @@ -1,23 +1,18 @@ -import email.utils import os import smtplib import time -import textwrap import requests from email.mime.text import MIMEText from django.conf import settings as djsettings -from django.contrib.contenttypes.models import ContentType from django.core.management.base import CommandError from django.core.urlresolvers import reverse from selenium.webdriver.support.select import Select from orchestra.admin.utils import change_url -from orchestra.apps.accounts.models import Account from orchestra.apps.domains.models import Domain from orchestra.apps.orchestration.models import Server, Route -from orchestra.apps.resources.models import Resource -from orchestra.utils.system import run, sshrun +from orchestra.utils.system import sshrun from orchestra.utils.tests import (BaseLiveServerTestCase, random_ascii, snapshot_on_error, save_response_on_error) diff --git a/orchestra/apps/mailboxes/admin.py b/orchestra/apps/mailboxes/admin.py index 455c4dd2..8968816b 100644 --- a/orchestra/apps/mailboxes/admin.py +++ b/orchestra/apps/mailboxes/admin.py @@ -3,13 +3,11 @@ from urllib.parse import parse_qs from django import forms from django.contrib import admin -from django.core.urlresolvers import reverse -from django.utils.safestring import mark_safe from django.utils.translation import ugettext_lazy as _ from orchestra.admin import ExtendedModelAdmin, ChangePasswordAdminMixin from orchestra.admin.utils import admin_link, change_url -from orchestra.apps.accounts.admin import SelectAccountAdminMixin, AccountAdminMixin +from orchestra.apps.accounts.admin import SelectAccountAdminMixin from orchestra.apps.accounts.filters import IsActiveListFilter from . import settings diff --git a/orchestra/apps/mailboxes/backends.py b/orchestra/apps/mailboxes/backends.py index 957dd99f..11f4f8e1 100644 --- a/orchestra/apps/mailboxes/backends.py +++ b/orchestra/apps/mailboxes/backends.py @@ -1,13 +1,10 @@ import logging import textwrap -import os from django.core.exceptions import ObjectDoesNotExist -from django.utils import timezone from django.utils.translation import ugettext_lazy as _ from orchestra.apps.orchestration import ServiceController -from orchestra.apps.systemusers.backends import SystemUserBackend from orchestra.apps.resources import ServiceMonitor #from orchestra.utils.humanize import unit_to_bytes diff --git a/orchestra/apps/mailboxes/forms.py b/orchestra/apps/mailboxes/forms.py index ffc2320f..0e54b37c 100644 --- a/orchestra/apps/mailboxes/forms.py +++ b/orchestra/apps/mailboxes/forms.py @@ -6,7 +6,7 @@ from django.utils.translation import ugettext_lazy as _ from orchestra.forms import UserCreationForm, UserChangeForm from orchestra.utils.python import AttrDict -from .models import Address, Mailbox +from .models import Address class MailboxForm(forms.ModelForm): diff --git a/orchestra/apps/mailboxes/serializers.py b/orchestra/apps/mailboxes/serializers.py index 017120a1..a273003f 100644 --- a/orchestra/apps/mailboxes/serializers.py +++ b/orchestra/apps/mailboxes/serializers.py @@ -1,6 +1,6 @@ from django.forms import widgets from django.shortcuts import get_object_or_404 -from django.utils.translation import ugettext, ugettext_lazy as _ +from django.utils.translation import ugettext_lazy as _ from rest_framework import serializers from orchestra.api.serializers import HyperlinkedModelSerializer diff --git a/orchestra/apps/mailboxes/tests/functional_tests/tests.py b/orchestra/apps/mailboxes/tests/functional_tests/tests.py index 6ece4a56..a1c4a336 100644 --- a/orchestra/apps/mailboxes/tests/functional_tests/tests.py +++ b/orchestra/apps/mailboxes/tests/functional_tests/tests.py @@ -1,4 +1,3 @@ -import email.utils import imaplib import os import poplib @@ -16,7 +15,7 @@ from selenium.webdriver.support.select import Select from orchestra.apps.orchestration.models import Server, Route from orchestra.apps.resources.models import Resource -from orchestra.utils.system import run, sshrun +from orchestra.utils.system import sshrun from orchestra.utils.tests import BaseLiveServerTestCase, random_ascii, snapshot_on_error, save_response_on_error from ... import backends, settings diff --git a/orchestra/apps/orchestration/admin.py b/orchestra/apps/orchestration/admin.py index 5e95ac57..8ac7f856 100644 --- a/orchestra/apps/orchestration/admin.py +++ b/orchestra/apps/orchestration/admin.py @@ -1,4 +1,3 @@ -from django import forms from django.contrib import admin from django.utils.html import escape from django.utils.translation import ugettext_lazy as _ diff --git a/orchestra/apps/orchestration/backends.py b/orchestra/apps/orchestration/backends.py index f508d69e..ff63ed6e 100644 --- a/orchestra/apps/orchestration/backends.py +++ b/orchestra/apps/orchestration/backends.py @@ -2,7 +2,6 @@ from functools import partial from django.apps import apps from django.utils import timezone -from django.utils.functional import cached_property from django.utils.translation import ugettext_lazy as _ from orchestra import plugins diff --git a/orchestra/apps/orchestration/management/commands/orchestrate.py b/orchestra/apps/orchestration/management/commands/orchestrate.py index e25c7039..bb6310ea 100644 --- a/orchestra/apps/orchestration/management/commands/orchestrate.py +++ b/orchestra/apps/orchestration/management/commands/orchestrate.py @@ -5,7 +5,6 @@ from django.db.models.loading import get_model from django.utils.six.moves import input from orchestra.apps.orchestration import manager -from orchestra.apps.orchestration.models import BackendOperation as Operation class Command(BaseCommand): diff --git a/orchestra/apps/orchestration/middlewares.py b/orchestra/apps/orchestration/middlewares.py index a9b08746..eff520d0 100644 --- a/orchestra/apps/orchestration/middlewares.py +++ b/orchestra/apps/orchestration/middlewares.py @@ -1,7 +1,7 @@ from threading import local from django.core.urlresolvers import resolve -from django.db import connection, transaction +from django.db import transaction from django.db.models.signals import pre_delete, post_save, m2m_changed from django.dispatch import receiver from django.http.response import HttpResponseServerError diff --git a/orchestra/apps/orders/helpers.py b/orchestra/apps/orders/helpers.py index dd40a3f0..7f08864b 100644 --- a/orchestra/apps/orders/helpers.py +++ b/orchestra/apps/orders/helpers.py @@ -1,6 +1,5 @@ from django.core.exceptions import ObjectDoesNotExist -from orchestra.apps.accounts.models import Account from orchestra.core import services diff --git a/orchestra/apps/orders/models.py b/orchestra/apps/orders/models.py index e82b8507..6bb05551 100644 --- a/orchestra/apps/orders/models.py +++ b/orchestra/apps/orders/models.py @@ -3,12 +3,10 @@ import decimal import logging from django.db import models -from django.db.migrations.recorder import MigrationRecorder from django.db.models import F, Q from django.db.models.loading import get_model from django.db.models.signals import post_delete, post_save, pre_delete from django.dispatch import receiver -from django.contrib.admin.models import LogEntry from django.contrib.contenttypes import generic from django.contrib.contenttypes.models import ContentType from django.utils import timezone diff --git a/orchestra/apps/payments/methods/options.py b/orchestra/apps/payments/methods/options.py index e69634f5..092e96dc 100644 --- a/orchestra/apps/payments/methods/options.py +++ b/orchestra/apps/payments/methods/options.py @@ -1,6 +1,4 @@ from dateutil import relativedelta -from django import forms -from django.core.exceptions import ValidationError from orchestra import plugins from orchestra.utils.functional import cached diff --git a/orchestra/apps/payments/methods/sepadirectdebit.py b/orchestra/apps/payments/methods/sepadirectdebit.py index 3d46c71b..5d871926 100644 --- a/orchestra/apps/payments/methods/sepadirectdebit.py +++ b/orchestra/apps/payments/methods/sepadirectdebit.py @@ -8,7 +8,6 @@ from io import StringIO from django import forms from django.utils import timezone from django.utils.translation import ugettext_lazy as _ -from django_iban.forms import IBANFormField from django_iban.validators import IBANValidator, IBAN_COUNTRY_CODE_LENGTH from rest_framework import serializers diff --git a/orchestra/apps/plans/admin.py b/orchestra/apps/plans/admin.py index ed5d7644..cd881354 100644 --- a/orchestra/apps/plans/admin.py +++ b/orchestra/apps/plans/admin.py @@ -1,8 +1,6 @@ from django.contrib import admin -from django.utils.translation import ugettext_lazy as _ from orchestra.admin import ExtendedModelAdmin -from orchestra.admin.filters import UsedContentTypeFilter from orchestra.admin.utils import insertattr from orchestra.apps.accounts.admin import AccountAdminMixin from orchestra.apps.services.models import Service diff --git a/orchestra/apps/plans/models.py b/orchestra/apps/plans/models.py index 1db219d3..33cf70bf 100644 --- a/orchestra/apps/plans/models.py +++ b/orchestra/apps/plans/models.py @@ -1,5 +1,3 @@ -import decimal - from django.core.validators import ValidationError from django.db import models from django.db.models import Q diff --git a/orchestra/apps/plans/rating.py b/orchestra/apps/plans/rating.py index 30e7e6a2..f7380ec4 100644 --- a/orchestra/apps/plans/rating.py +++ b/orchestra/apps/plans/rating.py @@ -1,6 +1,6 @@ import sys -from django.utils.translation import string_concat, ugettext_lazy as _ +from django.utils.translation import ugettext_lazy as _ from orchestra.utils.python import AttrDict diff --git a/orchestra/apps/resources/actions.py b/orchestra/apps/resources/actions.py index 1cf3d0aa..829da240 100644 --- a/orchestra/apps/resources/actions.py +++ b/orchestra/apps/resources/actions.py @@ -1,6 +1,4 @@ -from django.contrib import messages from django.core.urlresolvers import reverse -from django.db import transaction from django.shortcuts import redirect from django.utils.safestring import mark_safe from django.utils.translation import ungettext, ugettext_lazy as _ diff --git a/orchestra/apps/resources/admin.py b/orchestra/apps/resources/admin.py index daa76c3a..17de83a3 100644 --- a/orchestra/apps/resources/admin.py +++ b/orchestra/apps/resources/admin.py @@ -5,7 +5,6 @@ from django.contrib.contenttypes import generic from django.core.urlresolvers import reverse from django.shortcuts import redirect from django.utils.functional import cached_property -from django.utils.safestring import mark_safe from django.utils.translation import ungettext, ugettext, ugettext_lazy as _ from orchestra.admin import ExtendedModelAdmin diff --git a/orchestra/apps/saas/fields.py b/orchestra/apps/saas/fields.py index b1bbde7f..785e5eda 100644 --- a/orchestra/apps/saas/fields.py +++ b/orchestra/apps/saas/fields.py @@ -1,8 +1,6 @@ from django.contrib.contenttypes.fields import GenericRelation from django.db import DEFAULT_DB_ALIAS -from orchestra.apps.databases.models import Database - class VirtualDatabaseRelation(GenericRelation): """ Delete related databases if any """ diff --git a/orchestra/apps/saas/models.py b/orchestra/apps/saas/models.py index 85f72f1f..f943d0e3 100644 --- a/orchestra/apps/saas/models.py +++ b/orchestra/apps/saas/models.py @@ -6,7 +6,6 @@ from django.utils.translation import ugettext_lazy as _ from jsonfield import JSONField from orchestra.core import services, validators -from orchestra.models.fields import NullableCharField from .fields import VirtualDatabaseRelation from .services import SoftwareService diff --git a/orchestra/apps/saas/services/gitlab.py b/orchestra/apps/saas/services/gitlab.py index 2e124291..38343389 100644 --- a/orchestra/apps/saas/services/gitlab.py +++ b/orchestra/apps/saas/services/gitlab.py @@ -1,5 +1,4 @@ from django import forms -from django.core.exceptions import ValidationError from django.utils.translation import ugettext_lazy as _ from rest_framework import serializers diff --git a/orchestra/apps/saas/services/moodle.py b/orchestra/apps/saas/services/moodle.py index 08461ead..72e39bdc 100644 --- a/orchestra/apps/saas/services/moodle.py +++ b/orchestra/apps/saas/services/moodle.py @@ -1,8 +1,6 @@ from django import forms from django.utils.translation import ugettext_lazy as _ -from orchestra.plugins.forms import PluginDataForm - from .options import SoftwareService, SoftwareServiceForm diff --git a/orchestra/apps/saas/services/options.py b/orchestra/apps/saas/services/options.py index a355c54d..bdfd5e16 100644 --- a/orchestra/apps/saas/services/options.py +++ b/orchestra/apps/saas/services/options.py @@ -1,6 +1,5 @@ from django import forms from django.core.exceptions import ValidationError -from django.utils.safestring import mark_safe from django.utils.translation import ugettext_lazy as _ from orchestra import plugins diff --git a/orchestra/apps/saas/services/seafile.py b/orchestra/apps/saas/services/seafile.py index 951114a5..3484e2c6 100644 --- a/orchestra/apps/saas/services/seafile.py +++ b/orchestra/apps/saas/services/seafile.py @@ -1,5 +1,4 @@ from django import forms -from django.core.exceptions import ValidationError from django.utils.translation import ugettext_lazy as _ from rest_framework import serializers diff --git a/orchestra/apps/saas/services/wordpress.py b/orchestra/apps/saas/services/wordpress.py index ac61ec5a..a7b2a96d 100644 --- a/orchestra/apps/saas/services/wordpress.py +++ b/orchestra/apps/saas/services/wordpress.py @@ -1,5 +1,4 @@ from django import forms -from django.utils.safestring import mark_safe from django.utils.translation import ugettext_lazy as _ from rest_framework import serializers diff --git a/orchestra/apps/services/tests/test_handler.py b/orchestra/apps/services/tests/test_handler.py index eee34e65..e3f2b987 100644 --- a/orchestra/apps/services/tests/test_handler.py +++ b/orchestra/apps/services/tests/test_handler.py @@ -4,9 +4,8 @@ import decimal from django.contrib.contenttypes.models import ContentType from django.utils import timezone -from orchestra.apps.accounts.models import Account from orchestra.apps.systemusers.models import SystemUser -from orchestra.utils.tests import BaseTestCase, random_ascii +from orchestra.utils.tests import BaseTestCase from .. import helpers from ..models import Service, Plan diff --git a/orchestra/apps/systemusers/actions.py b/orchestra/apps/systemusers/actions.py index dd326f3e..7569c9be 100644 --- a/orchestra/apps/systemusers/actions.py +++ b/orchestra/apps/systemusers/actions.py @@ -1,16 +1,9 @@ -from functools import partial - from django import forms from django.contrib import messages, admin from django.core.exceptions import PermissionDenied -from django.db import transaction -from django.shortcuts import render -from django.utils.safestring import mark_safe -from django.utils.text import capfirst from django.utils.translation import ungettext, ugettext_lazy as _ from orchestra.admin.decorators import action_with_confirmation -from orchestra.admin.utils import change_url from orchestra.apps.orchestration.models import BackendOperation as Operation diff --git a/orchestra/apps/systemusers/admin.py b/orchestra/apps/systemusers/admin.py index 9a4a5b23..bf236767 100644 --- a/orchestra/apps/systemusers/admin.py +++ b/orchestra/apps/systemusers/admin.py @@ -1,21 +1,10 @@ -import textwrap - -from django import forms -from django.conf.urls import patterns, url -from django.core.urlresolvers import reverse from django.contrib import admin -from django.contrib.admin.util import unquote -from django.contrib.auth.admin import UserAdmin -from django.utils.translation import ugettext, ugettext_lazy as _ -from django.utils.safestring import mark_safe +from django.utils.translation import ugettext_lazy as _ from orchestra.admin import ExtendedModelAdmin, ChangePasswordAdminMixin -from orchestra.admin.utils import wrap_admin_view from orchestra.apps.accounts.admin import SelectAccountAdminMixin from orchestra.apps.accounts.filters import IsActiveListFilter -from orchestra.forms import UserCreationForm, UserChangeForm -from . import settings from .actions import grant_permission, delete_selected from .filters import IsMainListFilter from .forms import SystemUserCreationForm, SystemUserChangeForm diff --git a/orchestra/apps/systemusers/filters.py b/orchestra/apps/systemusers/filters.py index 81fb1143..1e78a1d9 100644 --- a/orchestra/apps/systemusers/filters.py +++ b/orchestra/apps/systemusers/filters.py @@ -1,6 +1,5 @@ from django.contrib.admin import SimpleListFilter from django.db.models import F -from django.utils.encoding import force_text from django.utils.translation import ugettext_lazy as _ diff --git a/orchestra/apps/systemusers/models.py b/orchestra/apps/systemusers/models.py index 7f39b09e..86757c92 100644 --- a/orchestra/apps/systemusers/models.py +++ b/orchestra/apps/systemusers/models.py @@ -2,7 +2,6 @@ import os from django.contrib.auth.hashers import make_password from django.core.exceptions import ValidationError -from django.core.mail import send_mail from django.db import models from django.utils.functional import cached_property from django.utils.translation import ugettext_lazy as _ diff --git a/orchestra/apps/systemusers/serializers.py b/orchestra/apps/systemusers/serializers.py index ab7b05a9..4270b193 100644 --- a/orchestra/apps/systemusers/serializers.py +++ b/orchestra/apps/systemusers/serializers.py @@ -1,8 +1,6 @@ -from django.contrib.auth import get_user_model -from django.core.exceptions import ValidationError from django.forms import widgets from django.shortcuts import get_object_or_404 -from django.utils.translation import ugettext, ugettext_lazy as _ +from django.utils.translation import ugettext_lazy as _ from rest_framework import serializers from orchestra.api.serializers import HyperlinkedModelSerializer diff --git a/orchestra/apps/systemusers/settings.py b/orchestra/apps/systemusers/settings.py index 7c0dceb0..fb9bd1f8 100644 --- a/orchestra/apps/systemusers/settings.py +++ b/orchestra/apps/systemusers/settings.py @@ -1,6 +1,6 @@ from django.conf import settings -from django.utils.translation import ugettext, ugettext_lazy as _ +from django.utils.translation import ugettext_lazy as _ SYSTEMUSERS_SHELLS = getattr(settings, 'SYSTEMUSERS_SHELLS', ( diff --git a/orchestra/apps/systemusers/tests/functional_tests/tests.py b/orchestra/apps/systemusers/tests/functional_tests/tests.py index 1d88273e..dd2997f0 100644 --- a/orchestra/apps/systemusers/tests/functional_tests/tests.py +++ b/orchestra/apps/systemusers/tests/functional_tests/tests.py @@ -17,7 +17,7 @@ from orchestra.utils.system import run, sshrun from orchestra.utils.tests import (BaseLiveServerTestCase, random_ascii, snapshot_on_error, save_response_on_error) -from ... import backends, settings +from ... import backends from ...models import SystemUser diff --git a/orchestra/apps/webapps/admin.py b/orchestra/apps/webapps/admin.py index e8f6c916..935e924b 100644 --- a/orchestra/apps/webapps/admin.py +++ b/orchestra/apps/webapps/admin.py @@ -10,7 +10,6 @@ from orchestra.apps.accounts.admin import AccountAdminMixin from orchestra.forms.widgets import DynamicHelpTextSelect from orchestra.plugins.admin import SelectPluginAdminMixin -from . import settings from .options import AppOption from .types import AppType from .models import WebApp, WebAppOption diff --git a/orchestra/apps/webapps/fields.py b/orchestra/apps/webapps/fields.py index cca540f3..7efd52b8 100644 --- a/orchestra/apps/webapps/fields.py +++ b/orchestra/apps/webapps/fields.py @@ -1,8 +1,6 @@ from django.contrib.contenttypes.fields import GenericRelation from django.db import DEFAULT_DB_ALIAS -from orchestra.apps.databases.models import Database, DatabaseUser - class VirtualDatabaseRelation(GenericRelation): """ Delete related databases if any """ diff --git a/orchestra/apps/webapps/models.py b/orchestra/apps/webapps/models.py index 24ff6b8c..3c471485 100644 --- a/orchestra/apps/webapps/models.py +++ b/orchestra/apps/webapps/models.py @@ -1,8 +1,5 @@ - import os -import re -from django.core.exceptions import ValidationError from django.db import models from django.db.models.signals import pre_save, pre_delete from django.dispatch import receiver diff --git a/orchestra/apps/webapps/serializers.py b/orchestra/apps/webapps/serializers.py index c11d675a..c8d293b8 100644 --- a/orchestra/apps/webapps/serializers.py +++ b/orchestra/apps/webapps/serializers.py @@ -1,5 +1,3 @@ -from rest_framework import serializers - from orchestra.api.fields import OptionField from orchestra.api.serializers import HyperlinkedModelSerializer from orchestra.apps.accounts.serializers import AccountSerializerMixin diff --git a/orchestra/apps/webapps/settings.py b/orchestra/apps/webapps/settings.py index 90616b06..01695fac 100644 --- a/orchestra/apps/webapps/settings.py +++ b/orchestra/apps/webapps/settings.py @@ -1,5 +1,4 @@ from django.conf import settings -from django.utils.translation import ugettext_lazy as _ from orchestra.settings import BASE_DOMAIN diff --git a/orchestra/apps/webapps/tests/functional_tests/tests.py b/orchestra/apps/webapps/tests/functional_tests/tests.py index ab64d74e..8a1ba9fc 100644 --- a/orchestra/apps/webapps/tests/functional_tests/tests.py +++ b/orchestra/apps/webapps/tests/functional_tests/tests.py @@ -1,25 +1,14 @@ import ftplib import os -import time -import textwrap from io import StringIO from django.conf import settings as djsettings -from django.contrib.contenttypes.models import ContentType -from django.core.management.base import CommandError -from django.core.urlresolvers import reverse -from selenium.webdriver.support.select import Select -from orchestra.apps.accounts.models import Account -from orchestra.apps.domains.models import Domain from orchestra.apps.orchestration.models import Server, Route -from orchestra.apps.resources.models import Resource from orchestra.apps.systemusers.backends import SystemUserBackend -from orchestra.utils.system import run, sshrun from orchestra.utils.tests import BaseLiveServerTestCase, random_ascii, snapshot_on_error, save_response_on_error -from ... import backends, settings -from ...models import WebApp +from ... import backends class WebAppMixin(object): diff --git a/orchestra/apps/webapps/types/cms.py b/orchestra/apps/webapps/types/cms.py index e9538cac..2ababf3c 100644 --- a/orchestra/apps/webapps/types/cms.py +++ b/orchestra/apps/webapps/types/cms.py @@ -7,11 +7,8 @@ from rest_framework import serializers from orchestra.apps.databases.models import Database, DatabaseUser from orchestra.forms import widgets -from orchestra.plugins.forms import PluginDataForm from orchestra.utils.python import random_ascii -from .. import settings - from .php import PHPApp, PHPAppForm, PHPAppSerializer diff --git a/orchestra/apps/webapps/types/misc.py b/orchestra/apps/webapps/types/misc.py index edff2685..e51e5f05 100644 --- a/orchestra/apps/webapps/types/misc.py +++ b/orchestra/apps/webapps/types/misc.py @@ -4,8 +4,6 @@ from django import forms from django.utils.translation import ugettext_lazy as _ from rest_framework import serializers -from orchestra.plugins.forms import PluginDataForm - from ..options import AppOption from . import AppType diff --git a/orchestra/apps/webapps/types/php.py b/orchestra/apps/webapps/types/php.py index 5d046624..99bbab06 100644 --- a/orchestra/apps/webapps/types/php.py +++ b/orchestra/apps/webapps/types/php.py @@ -5,7 +5,6 @@ from django import forms from django.utils.translation import ugettext_lazy as _ from rest_framework import serializers -from orchestra.forms import widgets from orchestra.plugins.forms import PluginDataForm from orchestra.utils.functional import cached diff --git a/orchestra/apps/websites/admin.py b/orchestra/apps/websites/admin.py index 5a2a28db..dbfc1730 100644 --- a/orchestra/apps/websites/admin.py +++ b/orchestra/apps/websites/admin.py @@ -11,7 +11,6 @@ from orchestra.admin.utils import admin_link, change_url from orchestra.apps.accounts.admin import AccountAdminMixin, SelectAccountAdminMixin from orchestra.forms.widgets import DynamicHelpTextSelect -from . import settings from .directives import SiteDirective from .forms import WebsiteAdminForm, WebsiteDirectiveInlineFormSet from .models import Content, Website, WebsiteDirective diff --git a/orchestra/apps/websites/models.py b/orchestra/apps/websites/models.py index 33089c8c..06e6d35e 100644 --- a/orchestra/apps/websites/models.py +++ b/orchestra/apps/websites/models.py @@ -1,7 +1,5 @@ import os -import re -from django.core.exceptions import ValidationError from django.db import models from django.utils.functional import cached_property from django.utils.translation import ugettext_lazy as _ diff --git a/orchestra/apps/websites/tests/functional_tests/tests.py b/orchestra/apps/websites/tests/functional_tests/tests.py index 50082460..a31de4e4 100644 --- a/orchestra/apps/websites/tests/functional_tests/tests.py +++ b/orchestra/apps/websites/tests/functional_tests/tests.py @@ -1,26 +1,15 @@ import os import socket -import time -import textwrap -from django.conf import settings as djsettings -from django.contrib.contenttypes.models import ContentType -from django.core.management.base import CommandError -from django.core.urlresolvers import reverse import requests -from selenium.webdriver.support.select import Select -from orchestra.apps.accounts.models import Account from orchestra.apps.domains.models import Domain, Record from orchestra.apps.domains.backends import Bind9MasterDomainBackend from orchestra.apps.orchestration.models import Server, Route -from orchestra.apps.resources.models import Resource from orchestra.apps.webapps.tests.functional_tests.tests import StaticWebAppMixin, RESTWebAppMixin, WebAppMixin, PHPFcidWebAppMixin, PHPFPMWebAppMixin -from orchestra.utils.system import run, sshrun -from orchestra.utils.tests import BaseLiveServerTestCase, random_ascii, snapshot_on_error, save_response_on_error +from orchestra.utils.tests import BaseLiveServerTestCase, random_ascii, save_response_on_error -from ... import backends, settings -from ...models import Website +from ... import backends class WebsiteMixin(WebAppMixin): diff --git a/orchestra/plugins/options.py b/orchestra/plugins/options.py index f48be673..2ee9c249 100644 --- a/orchestra/plugins/options.py +++ b/orchestra/plugins/options.py @@ -1,7 +1,5 @@ from django.core.exceptions import ValidationError -from orchestra.utils.functional import cached - class Plugin(object): verbose_name = None diff --git a/orchestra/utils/tests.py b/orchestra/utils/tests.py index 87489965..0811e47b 100644 --- a/orchestra/utils/tests.py +++ b/orchestra/utils/tests.py @@ -3,7 +3,7 @@ import os from functools import wraps from django.conf import settings -from django.contrib.auth import BACKEND_SESSION_KEY, SESSION_KEY, get_user_model +from django.contrib.auth import BACKEND_SESSION_KEY, SESSION_KEY from django.contrib.sessions.backends.db import SessionStore from django.core.urlresolvers import reverse from django.test import LiveServerTestCase, TestCase