diff --git a/horizon/__init__.py b/horizon/__init__.py index 1f065ab75c..7325d29d84 100644 --- a/horizon/__init__.py +++ b/horizon/__init__.py @@ -26,7 +26,10 @@ methods like :func:`~horizon.register` and :func:`~horizon.unregister`. # should that fail. Horizon = None try: - from horizon.base import Horizon, Dashboard, Panel, PanelGroup + from horizon.base import Dashboard + from horizon.base import Horizon + from horizon.base import Panel + from horizon.base import PanelGroup except ImportError: import warnings diff --git a/horizon/base.py b/horizon/base.py index d378852578..7b0c4f7217 100644 --- a/horizon/base.py +++ b/horizon/base.py @@ -29,7 +29,9 @@ import logging import os from django.conf import settings -from django.conf.urls.defaults import patterns, url, include +from django.conf.urls.defaults import include +from django.conf.urls.defaults import patterns +from django.conf.urls.defaults import url from django.core.exceptions import ImproperlyConfigured from django.core.urlresolvers import reverse from django.utils.datastructures import SortedDict @@ -38,9 +40,11 @@ from django.utils.importlib import import_module from django.utils.module_loading import module_has_submodule from django.utils.translation import ugettext_lazy as _ -from horizon import loaders from horizon import conf -from horizon.decorators import require_auth, require_perms, _current_component +from horizon.decorators import _current_component +from horizon.decorators import require_auth +from horizon.decorators import require_perms +from horizon import loaders LOG = logging.getLogger(__name__) diff --git a/horizon/browsers/base.py b/horizon/browsers/base.py index 30a7b15146..11bcd44625 100644 --- a/horizon/browsers/base.py +++ b/horizon/browsers/base.py @@ -17,9 +17,9 @@ from django import template from django.utils.translation import ugettext_lazy as _ +from horizon.browsers.breadcrumb import Breadcrumb from horizon.tables import DataTable from horizon.utils import html -from .breadcrumb import Breadcrumb class ResourceBrowser(html.HTMLElement): diff --git a/horizon/conf/__init__.py b/horizon/conf/__init__.py index b34b4f512a..4370028d9d 100644 --- a/horizon/conf/__init__.py +++ b/horizon/conf/__init__.py @@ -1,12 +1,13 @@ import copy -from django.utils.functional import LazyObject, empty +from django.utils.functional import empty +from django.utils.functional import LazyObject class LazySettings(LazyObject): def _setup(self, name=None): from django.conf import settings - from .default import HORIZON_CONFIG as DEFAULT_CONFIG + from horizon.conf.default import HORIZON_CONFIG as DEFAULT_CONFIG HORIZON_CONFIG = copy.copy(DEFAULT_CONFIG) HORIZON_CONFIG.update(settings.HORIZON_CONFIG) diff --git a/horizon/exceptions.py b/horizon/exceptions.py index e2da6d427d..d81c8c41c7 100644 --- a/horizon/exceptions.py +++ b/horizon/exceptions.py @@ -26,10 +26,11 @@ from django.contrib.auth import logout from django.http import HttpRequest from django.utils import termcolors from django.utils.translation import ugettext_lazy as _ -from django.views.debug import SafeExceptionReporterFilter, CLEANSED_SUBSTITUTE +from django.views.debug import CLEANSED_SUBSTITUTE +from django.views.debug import SafeExceptionReporterFilter -from horizon import messages from horizon.conf import HORIZON_CONFIG +from horizon import messages LOG = logging.getLogger(__name__) PALETTE = termcolors.PALETTES[termcolors.DEFAULT_PALETTE] diff --git a/horizon/forms/__init__.py b/horizon/forms/__init__.py index 5e946ec38d..611d59b791 100644 --- a/horizon/forms/__init__.py +++ b/horizon/forms/__init__.py @@ -19,9 +19,13 @@ from django.forms import * from django.forms import widgets # Convenience imports for public API components. -from .base import SelfHandlingMixin, SelfHandlingForm, DateForm -from .views import ModalFormView, ModalFormMixin -from .fields import DynamicTypedChoiceField, DynamicChoiceField +from horizon.forms.base import DateForm +from horizon.forms.base import SelfHandlingForm +from horizon.forms.base import SelfHandlingMixin +from horizon.forms.fields import DynamicChoiceField +from horizon.forms.fields import DynamicTypedChoiceField +from horizon.forms.views import ModalFormMixin +from horizon.forms.views import ModalFormView assert widgets assert SelfHandlingMixin diff --git a/horizon/forms/base.py b/horizon/forms/base.py index 2357ea5042..af6510ee70 100644 --- a/horizon/forms/base.py +++ b/horizon/forms/base.py @@ -20,7 +20,8 @@ from django import forms from django.forms.forms import NON_FIELD_ERRORS -from django.utils import dates, timezone +from django.utils import dates +from django.utils import timezone class SelfHandlingMixin(object): diff --git a/horizon/forms/fields.py b/horizon/forms/fields.py index b728e74ee9..38dd2250d6 100644 --- a/horizon/forms/fields.py +++ b/horizon/forms/fields.py @@ -15,7 +15,8 @@ # under the License. from django.core import urlresolvers -from django.forms import fields, widgets +from django.forms import fields +from django.forms import widgets class DynamicSelectWidget(widgets.Select): diff --git a/horizon/middleware.py b/horizon/middleware.py index abd0077e37..645a1ea0f8 100644 --- a/horizon/middleware.py +++ b/horizon/middleware.py @@ -24,14 +24,14 @@ Middleware provided and used by Horizon. import json import logging -from django import http -from django import shortcuts from django.conf import settings -from django.contrib import messages as django_messages from django.contrib.auth import REDIRECT_FIELD_NAME from django.contrib.auth.views import redirect_to_login -from django.utils import timezone +from django.contrib import messages as django_messages +from django import http +from django import shortcuts from django.utils.encoding import iri_to_uri +from django.utils import timezone from horizon import exceptions diff --git a/horizon/site_urls.py b/horizon/site_urls.py index b25b0625b7..78dd14b6e2 100644 --- a/horizon/site_urls.py +++ b/horizon/site_urls.py @@ -18,9 +18,11 @@ # License for the specific language governing permissions and limitations # under the License. -from django.views.generic import TemplateView -from django.conf.urls.defaults import patterns, url, include from django.conf import settings +from django.conf.urls.defaults import include +from django.conf.urls.defaults import patterns +from django.conf.urls.defaults import url +from django.views.generic import TemplateView urlpatterns = patterns('horizon.views', diff --git a/horizon/tables/__init__.py b/horizon/tables/__init__.py index e987091d2a..d279db6372 100644 --- a/horizon/tables/__init__.py +++ b/horizon/tables/__init__.py @@ -15,11 +15,19 @@ # under the License. # Convenience imports for public API components. -from .actions import (Action, BatchAction, DeleteAction, - LinkAction, FilterAction, FixedFilterAction) -from .base import DataTable, Column, Row -from .views import DataTableView, MultiTableView, MultiTableMixin, \ - MixedDataTableView +from horizon.tables.actions import Action +from horizon.tables.actions import BatchAction +from horizon.tables.actions import DeleteAction +from horizon.tables.actions import FilterAction +from horizon.tables.actions import FixedFilterAction +from horizon.tables.actions import LinkAction +from horizon.tables.base import Column +from horizon.tables.base import DataTable +from horizon.tables.base import Row +from horizon.tables.views import DataTableView +from horizon.tables.views import MixedDataTableView +from horizon.tables.views import MultiTableMixin +from horizon.tables.views import MultiTableView assert Action assert BatchAction diff --git a/horizon/tables/actions.py b/horizon/tables/actions.py index b84e50ad93..068408c4dc 100644 --- a/horizon/tables/actions.py +++ b/horizon/tables/actions.py @@ -14,19 +14,20 @@ # License for the specific language governing permissions and limitations # under the License. +from collections import defaultdict import logging import new -from collections import defaultdict -from django import shortcuts from django.conf import settings from django.core import urlresolvers +from django import shortcuts from django.utils.functional import Promise from django.utils.translation import ugettext_lazy as _ from horizon import exceptions from horizon import messages -from horizon.utils import html, functions +from horizon.utils import functions +from horizon.utils import html LOG = logging.getLogger(__name__) diff --git a/horizon/tables/base.py b/horizon/tables/base.py index a96e85f067..bc1933b447 100644 --- a/horizon/tables/base.py +++ b/horizon/tables/base.py @@ -20,26 +20,27 @@ import logging from operator import attrgetter import sys +from django.conf import settings +from django.core import urlresolvers from django import forms from django.http import HttpResponse from django import template -from django.conf import settings -from django.core import urlresolvers from django.template.defaultfilters import truncatechars from django.template.loader import render_to_string -from django.utils import http from django.utils.datastructures import SortedDict from django.utils.html import escape +from django.utils import http from django.utils.http import urlencode -from django.utils.translation import ugettext_lazy as _ from django.utils.safestring import mark_safe from django.utils import termcolors +from django.utils.translation import ugettext_lazy as _ from horizon import conf from horizon import exceptions from horizon import messages +from horizon.tables.actions import FilterAction +from horizon.tables.actions import LinkAction from horizon.utils import html -from .actions import FilterAction, LinkAction LOG = logging.getLogger(__name__) diff --git a/horizon/tabs/__init__.py b/horizon/tabs/__init__.py index 9ac72c6b37..75a7dddefd 100644 --- a/horizon/tabs/__init__.py +++ b/horizon/tabs/__init__.py @@ -14,8 +14,11 @@ # License for the specific language governing permissions and limitations # under the License. -from .base import TabGroup, Tab, TableTab -from .views import TabView, TabbedTableView +from horizon.tabs.base import Tab +from horizon.tabs.base import TabGroup +from horizon.tabs.base import TableTab +from horizon.tabs.views import TabbedTableView +from horizon.tabs.views import TabView assert TabGroup assert Tab diff --git a/horizon/tabs/base.py b/horizon/tabs/base.py index 3ff0c1ea17..68da670945 100644 --- a/horizon/tabs/base.py +++ b/horizon/tabs/base.py @@ -16,8 +16,8 @@ import sys -from django.template import TemplateSyntaxError from django.template.loader import render_to_string +from django.template import TemplateSyntaxError from django.utils.datastructures import SortedDict from horizon import exceptions diff --git a/horizon/tabs/views.py b/horizon/tabs/views.py index ca509a57f5..cc683b928f 100644 --- a/horizon/tabs/views.py +++ b/horizon/tabs/views.py @@ -3,7 +3,7 @@ from django.views import generic from horizon import exceptions from horizon import tables -from .base import TableTab +from horizon.tabs.base import TableTab class TabView(generic.TemplateView): diff --git a/horizon/templatetags/branding.py b/horizon/templatetags/branding.py index 8152c9506b..195c4cdfd9 100644 --- a/horizon/templatetags/branding.py +++ b/horizon/templatetags/branding.py @@ -22,8 +22,8 @@ Template tags for customizing Horizon. """ -from django import template from django.conf import settings +from django import template from django.utils.translation import ugettext_lazy as _ diff --git a/horizon/templatetags/horizon.py b/horizon/templatetags/horizon.py index c31e561562..4de7ab33b7 100644 --- a/horizon/templatetags/horizon.py +++ b/horizon/templatetags/horizon.py @@ -17,8 +17,8 @@ from __future__ import absolute_import from django import template -from django.utils.encoding import force_unicode from django.utils.datastructures import SortedDict +from django.utils.encoding import force_unicode from django.utils.translation import ugettext_lazy as _ from horizon.base import Horizon diff --git a/horizon/templatetags/sizeformat.py b/horizon/templatetags/sizeformat.py index 8d465596ff..ee2ba41abd 100644 --- a/horizon/templatetags/sizeformat.py +++ b/horizon/templatetags/sizeformat.py @@ -23,8 +23,8 @@ Template tags for displaying sizes """ from django import template -from django.utils import translation from django.utils import formats +from django.utils import translation register = template.Library() diff --git a/horizon/test/helpers.py b/horizon/test/helpers.py index ccdc46e161..3853e8751e 100644 --- a/horizon/test/helpers.py +++ b/horizon/test/helpers.py @@ -21,14 +21,14 @@ import os import socket -from django import http -from django import test as django_test +from django.contrib.auth.middleware import AuthenticationMiddleware from django.contrib.auth.models import Permission +from django.contrib.auth.models import User from django.contrib.contenttypes.models import ContentType from django.contrib.messages.storage import default_storage -from django.contrib.auth.middleware import AuthenticationMiddleware -from django.contrib.auth.models import User from django.core.handlers import wsgi +from django import http +from django import test as django_test from django.test.client import RequestFactory from django.utils import unittest diff --git a/horizon/test/test_dashboards/cats/kittens/urls.py b/horizon/test/test_dashboards/cats/kittens/urls.py index 1ba0c0942b..f660597185 100644 --- a/horizon/test/test_dashboards/cats/kittens/urls.py +++ b/horizon/test/test_dashboards/cats/kittens/urls.py @@ -1,6 +1,7 @@ -from django.conf.urls.defaults import patterns, url +from django.conf.urls.defaults import patterns +from django.conf.urls.defaults import url -from .views import IndexView +from horizon.test.test_dashboards.cats.kittens.views import IndexView urlpatterns = patterns('', url(r'^$', IndexView.as_view(), name='index'), diff --git a/horizon/test/test_dashboards/cats/tigers/urls.py b/horizon/test/test_dashboards/cats/tigers/urls.py index 1ba0c0942b..65352324c4 100644 --- a/horizon/test/test_dashboards/cats/tigers/urls.py +++ b/horizon/test/test_dashboards/cats/tigers/urls.py @@ -1,6 +1,7 @@ -from django.conf.urls.defaults import patterns, url +from django.conf.urls.defaults import patterns +from django.conf.urls.defaults import url -from .views import IndexView +from horizon.test.test_dashboards.cats.tigers.views import IndexView urlpatterns = patterns('', url(r'^$', IndexView.as_view(), name='index'), diff --git a/horizon/test/test_dashboards/dogs/puppies/urls.py b/horizon/test/test_dashboards/dogs/puppies/urls.py index 1ba0c0942b..356501850e 100644 --- a/horizon/test/test_dashboards/dogs/puppies/urls.py +++ b/horizon/test/test_dashboards/dogs/puppies/urls.py @@ -1,6 +1,7 @@ -from django.conf.urls.defaults import patterns, url +from django.conf.urls.defaults import patterns +from django.conf.urls.defaults import url -from .views import IndexView +from horizon.test.test_dashboards.dogs.puppies.views import IndexView urlpatterns = patterns('', url(r'^$', IndexView.as_view(), name='index'), diff --git a/horizon/test/tests/tables.py b/horizon/test/tests/tables.py index 4560005f5e..d17dc95d06 100644 --- a/horizon/test/tests/tables.py +++ b/horizon/test/tests/tables.py @@ -14,9 +14,9 @@ # License for the specific language governing permissions and limitations # under the License. +from django.core.urlresolvers import reverse from django import http from django import shortcuts -from django.core.urlresolvers import reverse from django.utils.translation import ugettext_lazy as _ from mox import IsA diff --git a/horizon/test/tests/tabs.py b/horizon/test/tests/tabs.py index 543593fed1..346fe581c0 100644 --- a/horizon/test/tests/tabs.py +++ b/horizon/test/tests/tabs.py @@ -23,7 +23,8 @@ from horizon import exceptions from horizon import tabs as horizon_tabs from horizon.test import helpers as test -from .tables import MyTable, TEST_DATA +from horizon.test.tests.tables import MyTable +from horizon.test.tests.tables import TEST_DATA class BaseTestTab(horizon_tabs.Tab): diff --git a/horizon/test/tests/templatetags.py b/horizon/test/tests/templatetags.py index e22c590817..2c772c2696 100644 --- a/horizon/test/tests/templatetags.py +++ b/horizon/test/tests/templatetags.py @@ -20,9 +20,10 @@ import re -from django.utils.text import normalize_newlines -from django.template import Context, Template from django.conf import settings +from django.template import Context +from django.template import Template +from django.utils.text import normalize_newlines from horizon.test import helpers as test diff --git a/horizon/test/tests/workflows.py b/horizon/test/tests/workflows.py index 8ac0869059..005228420f 100644 --- a/horizon/test/tests/workflows.py +++ b/horizon/test/tests/workflows.py @@ -19,8 +19,8 @@ from django import http from django.utils.translation import ugettext_lazy as _ from horizon import exceptions -from horizon import workflows from horizon.test import helpers as test +from horizon import workflows PROJECT_ID = "a23lkjre389fwenj" diff --git a/horizon/test/urls.py b/horizon/test/urls.py index e4f8e2effa..4fd0957b6b 100644 --- a/horizon/test/urls.py +++ b/horizon/test/urls.py @@ -22,7 +22,9 @@ URL patterns for testing Horizon views. """ -from django.conf.urls.defaults import patterns, url, include +from django.conf.urls.defaults import include +from django.conf.urls.defaults import patterns +from django.conf.urls.defaults import url from django.contrib.staticfiles.urls import staticfiles_urlpatterns from django.views.generic import TemplateView diff --git a/horizon/utils/fields.py b/horizon/utils/fields.py index c739399bdc..7522b3b1a3 100644 --- a/horizon/utils/fields.py +++ b/horizon/utils/fields.py @@ -1,11 +1,13 @@ -import re -import netaddr from django.core.exceptions import ValidationError -from django.forms import forms, widgets -from django.utils.translation import ugettext_lazy as _ +from django.forms import forms +from django.forms import widgets from django.utils.encoding import force_unicode -from django.utils.html import escape, conditional_escape from django.utils.functional import Promise +from django.utils.html import conditional_escape +from django.utils.html import escape +from django.utils.translation import ugettext_lazy as _ +import netaddr +import re ip_allowed_symbols_re = re.compile(r'^[a-fA-F0-9:/\.]+$') IPv4 = 1 diff --git a/horizon/utils/secret_key.py b/horizon/utils/secret_key.py index c45091382f..6df5533f1c 100644 --- a/horizon/utils/secret_key.py +++ b/horizon/utils/secret_key.py @@ -18,9 +18,9 @@ from __future__ import with_statement # Python 2.5 compliance import lockfile +import os import random import string -import os class FilePermissionError(Exception): diff --git a/horizon/workflows/__init__.py b/horizon/workflows/__init__.py index 6374b4d506..b4ec576fb8 100644 --- a/horizon/workflows/__init__.py +++ b/horizon/workflows/__init__.py @@ -1,5 +1,8 @@ -from .base import Workflow, Step, Action, UpdateMembersStep -from .views import WorkflowView +from horizon.workflows.base import Action +from horizon.workflows.base import Step +from horizon.workflows.base import UpdateMembersStep +from horizon.workflows.base import Workflow +from horizon.workflows.views import WorkflowView assert Action assert Step diff --git a/horizon/workflows/base.py b/horizon/workflows/base.py index 78d6ad3a14..e1356513a6 100644 --- a/horizon/workflows/base.py +++ b/horizon/workflows/base.py @@ -18,15 +18,16 @@ import copy import inspect import logging -from django import forms -from django import template from django.core import urlresolvers +from django import forms +from django.forms.forms import NON_FIELD_ERRORS +from django import template +from django.template.defaultfilters import linebreaks +from django.template.defaultfilters import safe from django.template.defaultfilters import slugify from django.utils.encoding import force_unicode from django.utils.importlib import import_module from django.utils.translation import ugettext_lazy as _ -from django.template.defaultfilters import linebreaks, safe -from django.forms.forms import NON_FIELD_ERRORS from horizon import base from horizon import exceptions diff --git a/horizon/workflows/views.py b/horizon/workflows/views.py index 1e5d7280ba..6bfb339fcd 100644 --- a/horizon/workflows/views.py +++ b/horizon/workflows/views.py @@ -22,8 +22,8 @@ from django import shortcuts from django.views import generic from horizon import exceptions -from horizon import messages from horizon.forms.views import ADD_TO_FIELD_HEADER +from horizon import messages class WorkflowView(generic.TemplateView): diff --git a/openstack_dashboard/api/__init__.py b/openstack_dashboard/api/__init__.py index a4f679ec02..98d96594d5 100644 --- a/openstack_dashboard/api/__init__.py +++ b/openstack_dashboard/api/__init__.py @@ -35,13 +35,13 @@ Keystone/Nova/Glance/Swift et. al. """ from openstack_dashboard.api import base from openstack_dashboard.api import cinder -from openstack_dashboard.api import heat from openstack_dashboard.api import glance +from openstack_dashboard.api import heat from openstack_dashboard.api import keystone +from openstack_dashboard.api import lbaas from openstack_dashboard.api import network from openstack_dashboard.api import nova from openstack_dashboard.api import quantum -from openstack_dashboard.api import lbaas from openstack_dashboard.api import swift assert base diff --git a/openstack_dashboard/api/cinder.py b/openstack_dashboard/api/cinder.py index 9983a6862c..aa6b7740e5 100644 --- a/openstack_dashboard/api/cinder.py +++ b/openstack_dashboard/api/cinder.py @@ -29,10 +29,11 @@ from django.utils.translation import ugettext_lazy as _ from cinderclient.v1 import client as cinder_client +from horizon import exceptions + +from openstack_dashboard.api.base import QuotaSet from openstack_dashboard.api.base import url_for from openstack_dashboard.api import nova -from openstack_dashboard.api.base import QuotaSet -from horizon import exceptions LOG = logging.getLogger(__name__) diff --git a/openstack_dashboard/api/nova.py b/openstack_dashboard/api/nova.py index dd0d38d935..e73b280eba 100644 --- a/openstack_dashboard/api/nova.py +++ b/openstack_dashboard/api/nova.py @@ -35,8 +35,10 @@ from novaclient.v1_1.servers import REBOOT_HARD from horizon.conf import HORIZON_CONFIG from horizon.utils.memoized import memoized -from openstack_dashboard.api.base import (APIResourceWrapper, QuotaSet, - APIDictWrapper, url_for) +from openstack_dashboard.api.base import APIDictWrapper +from openstack_dashboard.api.base import APIResourceWrapper +from openstack_dashboard.api.base import QuotaSet +from openstack_dashboard.api.base import url_for from openstack_dashboard.api import network diff --git a/openstack_dashboard/api/quantum.py b/openstack_dashboard/api/quantum.py index 8670d3ab27..453e08554a 100644 --- a/openstack_dashboard/api/quantum.py +++ b/openstack_dashboard/api/quantum.py @@ -24,13 +24,14 @@ from __future__ import absolute_import import logging from django.conf import settings -from quantumclient.v2_0 import client as quantum_client from django.utils.datastructures import SortedDict -from openstack_dashboard.api.base import APIDictWrapper, url_for +from openstack_dashboard.api.base import APIDictWrapper +from openstack_dashboard.api.base import url_for from openstack_dashboard.api import network from openstack_dashboard.api import nova +from quantumclient.v2_0 import client as quantum_client LOG = logging.getLogger(__name__) diff --git a/openstack_dashboard/api/swift.py b/openstack_dashboard/api/swift.py index ead62568e2..f13ddc42a5 100644 --- a/openstack_dashboard/api/swift.py +++ b/openstack_dashboard/api/swift.py @@ -23,12 +23,13 @@ import logging import swiftclient from django.conf import settings +from django.utils.translation import ugettext_lazy as _ from horizon import exceptions from horizon import messages -from django.utils.translation import ugettext_lazy as _ -from openstack_dashboard.api.base import url_for, APIDictWrapper +from openstack_dashboard.api.base import APIDictWrapper +from openstack_dashboard.api.base import url_for LOG = logging.getLogger(__name__) diff --git a/openstack_dashboard/dashboards/admin/domains/tables.py b/openstack_dashboard/dashboards/admin/domains/tables.py index 787a045f8f..5d62008912 100644 --- a/openstack_dashboard/dashboards/admin/domains/tables.py +++ b/openstack_dashboard/dashboards/admin/domains/tables.py @@ -25,8 +25,8 @@ from horizon import tables from openstack_dashboard import api -from .constants import DOMAINS_CREATE_URL, \ - DOMAINS_UPDATE_URL +from .constants import DOMAINS_CREATE_URL +from .constants import DOMAINS_UPDATE_URL LOG = logging.getLogger(__name__) diff --git a/openstack_dashboard/dashboards/admin/domains/tests.py b/openstack_dashboard/dashboards/admin/domains/tests.py index 3cebee7ffd..6c1bc9b5b4 100644 --- a/openstack_dashboard/dashboards/admin/domains/tests.py +++ b/openstack_dashboard/dashboards/admin/domains/tests.py @@ -15,21 +15,23 @@ # under the License. -from django import http from django.core.urlresolvers import reverse +from django import http -from mox import IgnoreArg, IsA +from mox import IgnoreArg +from mox import IsA from horizon.workflows.views import WorkflowView from openstack_dashboard import api from openstack_dashboard.test import helpers as test -from .constants import DOMAINS_INDEX_VIEW_TEMPLATE, \ - DOMAINS_INDEX_URL as index_url, \ - DOMAINS_CREATE_URL as create_url, \ - DOMAINS_UPDATE_URL as update_url -from .workflows import CreateDomain, UpdateDomain +from .constants import DOMAINS_CREATE_URL as create_url +from .constants import DOMAINS_INDEX_URL as index_url +from .constants import DOMAINS_INDEX_VIEW_TEMPLATE +from .constants import DOMAINS_UPDATE_URL as update_url +from .workflows import CreateDomain +from .workflows import UpdateDomain DOMAINS_INDEX_URL = reverse(index_url) diff --git a/openstack_dashboard/dashboards/admin/domains/urls.py b/openstack_dashboard/dashboards/admin/domains/urls.py index e9eaef6d87..4ef3120286 100644 --- a/openstack_dashboard/dashboards/admin/domains/urls.py +++ b/openstack_dashboard/dashboards/admin/domains/urls.py @@ -14,9 +14,12 @@ # License for the specific language governing permissions and limitations # under the License. -from django.conf.urls.defaults import patterns, url +from django.conf.urls.defaults import patterns +from django.conf.urls.defaults import url -from .views import IndexView, CreateDomainView, UpdateDomainView +from .views import CreateDomainView +from .views import IndexView +from .views import UpdateDomainView urlpatterns = patterns('', diff --git a/openstack_dashboard/dashboards/admin/domains/views.py b/openstack_dashboard/dashboards/admin/domains/views.py index 58e925bff5..2a6ff8994f 100644 --- a/openstack_dashboard/dashboards/admin/domains/views.py +++ b/openstack_dashboard/dashboards/admin/domains/views.py @@ -22,10 +22,13 @@ from horizon import tables from horizon import workflows from openstack_dashboard import api -from .constants import DOMAIN_INFO_FIELDS, DOMAINS_INDEX_URL, \ - DOMAINS_INDEX_VIEW_TEMPLATE + +from .constants import DOMAIN_INFO_FIELDS +from .constants import DOMAINS_INDEX_URL +from .constants import DOMAINS_INDEX_VIEW_TEMPLATE from .tables import DomainsTable -from .workflows import CreateDomain, UpdateDomain +from .workflows import CreateDomain +from .workflows import UpdateDomain class IndexView(tables.DataTableView): diff --git a/openstack_dashboard/dashboards/admin/domains/workflows.py b/openstack_dashboard/dashboards/admin/domains/workflows.py index cbee44083b..8e4821a798 100644 --- a/openstack_dashboard/dashboards/admin/domains/workflows.py +++ b/openstack_dashboard/dashboards/admin/domains/workflows.py @@ -19,8 +19,8 @@ import logging from django.utils.translation import ugettext_lazy as _ from horizon import exceptions -from horizon import workflows from horizon import forms +from horizon import workflows from openstack_dashboard import api diff --git a/openstack_dashboard/dashboards/admin/flavors/extras/forms.py b/openstack_dashboard/dashboards/admin/flavors/extras/forms.py index 93d37ee949..3cdbf2290b 100644 --- a/openstack_dashboard/dashboards/admin/flavors/extras/forms.py +++ b/openstack_dashboard/dashboards/admin/flavors/extras/forms.py @@ -23,6 +23,7 @@ import logging from django.utils.translation import ugettext_lazy as _ from openstack_dashboard import api + from horizon import exceptions from horizon import forms from horizon import messages diff --git a/openstack_dashboard/dashboards/admin/flavors/extras/tests.py b/openstack_dashboard/dashboards/admin/flavors/extras/tests.py index 54a4accde0..946645a03e 100644 --- a/openstack_dashboard/dashboards/admin/flavors/extras/tests.py +++ b/openstack_dashboard/dashboards/admin/flavors/extras/tests.py @@ -1,5 +1,5 @@ -from django import http from django.core.urlresolvers import reverse +from django import http from mox import IsA diff --git a/openstack_dashboard/dashboards/admin/flavors/extras/urls.py b/openstack_dashboard/dashboards/admin/flavors/extras/urls.py index b39211a7a2..c004f3ed61 100644 --- a/openstack_dashboard/dashboards/admin/flavors/extras/urls.py +++ b/openstack_dashboard/dashboards/admin/flavors/extras/urls.py @@ -18,9 +18,12 @@ # License for the specific language governing permissions and limitations # under the License. -from django.conf.urls.defaults import patterns, url +from django.conf.urls.defaults import patterns +from django.conf.urls.defaults import url -from .views import IndexView, EditView, CreateView +from .views import CreateView +from .views import EditView +from .views import IndexView urlpatterns = patterns('', url(r'^$', IndexView.as_view(), name='index'), diff --git a/openstack_dashboard/dashboards/admin/flavors/extras/views.py b/openstack_dashboard/dashboards/admin/flavors/extras/views.py index 87caa7221f..262f404466 100644 --- a/openstack_dashboard/dashboards/admin/flavors/extras/views.py +++ b/openstack_dashboard/dashboards/admin/flavors/extras/views.py @@ -27,8 +27,10 @@ from horizon import forms from horizon import tables from openstack_dashboard import api + +from .forms import CreateExtraSpec +from .forms import EditExtraSpec from .tables import ExtraSpecsTable -from .forms import CreateExtraSpec, EditExtraSpec LOG = logging.getLogger(__name__) diff --git a/openstack_dashboard/dashboards/admin/flavors/tests.py b/openstack_dashboard/dashboards/admin/flavors/tests.py index 93f6be944f..d69f94c1ce 100644 --- a/openstack_dashboard/dashboards/admin/flavors/tests.py +++ b/openstack_dashboard/dashboards/admin/flavors/tests.py @@ -1,9 +1,10 @@ -from django import http from django.core.urlresolvers import reverse +from django import http from mox import IsA from openstack_dashboard import api from openstack_dashboard.test import helpers as test + from novaclient.v1_1 import flavors diff --git a/openstack_dashboard/dashboards/admin/flavors/urls.py b/openstack_dashboard/dashboards/admin/flavors/urls.py index 522367e0e6..b820c136db 100644 --- a/openstack_dashboard/dashboards/admin/flavors/urls.py +++ b/openstack_dashboard/dashboards/admin/flavors/urls.py @@ -18,9 +18,14 @@ # License for the specific language governing permissions and limitations # under the License. -from django.conf.urls.defaults import patterns, url, include -from .views import IndexView, CreateView, EditView +from django.conf.urls.defaults import include +from django.conf.urls.defaults import patterns +from django.conf.urls.defaults import url + from .extras import urls as extras_urls +from .views import CreateView +from .views import EditView +from .views import IndexView urlpatterns = patterns('openstack_dashboard.dashboards.admin.flavors.views', url(r'^$', IndexView.as_view(), name='index'), diff --git a/openstack_dashboard/dashboards/admin/flavors/views.py b/openstack_dashboard/dashboards/admin/flavors/views.py index 5b621c7f74..dbd68994b0 100644 --- a/openstack_dashboard/dashboards/admin/flavors/views.py +++ b/openstack_dashboard/dashboards/admin/flavors/views.py @@ -28,7 +28,9 @@ from horizon import forms from horizon import tables from openstack_dashboard import api -from .forms import CreateFlavor, EditFlavor + +from .forms import CreateFlavor +from .forms import EditFlavor from .tables import FlavorsTable diff --git a/openstack_dashboard/dashboards/admin/groups/tables.py b/openstack_dashboard/dashboards/admin/groups/tables.py index 87b8e2480a..5c69308085 100644 --- a/openstack_dashboard/dashboards/admin/groups/tables.py +++ b/openstack_dashboard/dashboards/admin/groups/tables.py @@ -24,8 +24,10 @@ from horizon import tables from openstack_dashboard import api -from .constants import GROUPS_CREATE_URL, GROUPS_UPDATE_URL, \ - GROUPS_MANAGE_URL, GROUPS_ADD_MEMBER_URL +from .constants import GROUPS_ADD_MEMBER_URL +from .constants import GROUPS_CREATE_URL +from .constants import GROUPS_MANAGE_URL +from .constants import GROUPS_UPDATE_URL LOG = logging.getLogger(__name__) diff --git a/openstack_dashboard/dashboards/admin/groups/tests.py b/openstack_dashboard/dashboards/admin/groups/tests.py index e259c39228..0dccde198c 100644 --- a/openstack_dashboard/dashboards/admin/groups/tests.py +++ b/openstack_dashboard/dashboards/admin/groups/tests.py @@ -14,21 +14,22 @@ # License for the specific language governing permissions and limitations # under the License. -from django import http from django.core.urlresolvers import reverse +from django import http -from mox import IgnoreArg, IsA +from mox import IgnoreArg +from mox import IsA from openstack_dashboard import api from openstack_dashboard.test import helpers as test -from .constants import GROUPS_INDEX_VIEW_TEMPLATE, \ - GROUPS_MANAGE_VIEW_TEMPLATE, \ - GROUPS_INDEX_URL as index_url, \ - GROUPS_CREATE_URL as create_url, \ - GROUPS_UPDATE_URL as update_url, \ - GROUPS_MANAGE_URL as manage_url, \ - GROUPS_ADD_MEMBER_URL as add_member_url +from .constants import GROUPS_ADD_MEMBER_URL as add_member_url +from .constants import GROUPS_CREATE_URL as create_url +from .constants import GROUPS_INDEX_URL as index_url +from .constants import GROUPS_INDEX_VIEW_TEMPLATE +from .constants import GROUPS_MANAGE_URL as manage_url +from .constants import GROUPS_MANAGE_VIEW_TEMPLATE +from .constants import GROUPS_UPDATE_URL as update_url GROUPS_INDEX_URL = reverse(index_url) diff --git a/openstack_dashboard/dashboards/admin/groups/urls.py b/openstack_dashboard/dashboards/admin/groups/urls.py index dc1db02f96..b02de5ccbb 100644 --- a/openstack_dashboard/dashboards/admin/groups/urls.py +++ b/openstack_dashboard/dashboards/admin/groups/urls.py @@ -14,10 +14,14 @@ # License for the specific language governing permissions and limitations # under the License. -from django.conf.urls.defaults import patterns, url +from django.conf.urls.defaults import patterns +from django.conf.urls.defaults import url -from .views import IndexView, CreateView, UpdateView, \ - ManageMembersView, NonMembersView +from .views import CreateView +from .views import IndexView +from .views import ManageMembersView +from .views import NonMembersView +from .views import UpdateView urlpatterns = patterns('', diff --git a/openstack_dashboard/dashboards/admin/groups/views.py b/openstack_dashboard/dashboards/admin/groups/views.py index 86b8084e16..eab74e7283 100644 --- a/openstack_dashboard/dashboards/admin/groups/views.py +++ b/openstack_dashboard/dashboards/admin/groups/views.py @@ -14,7 +14,8 @@ # License for the specific language governing permissions and limitations # under the License. -from django.core.urlresolvers import reverse, reverse_lazy +from django.core.urlresolvers import reverse +from django.core.urlresolvers import reverse_lazy from django.utils.translation import ugettext_lazy as _ from horizon import exceptions @@ -22,13 +23,19 @@ from horizon import forms from horizon import tables from openstack_dashboard import api -from .constants import GROUPS_INDEX_URL, GROUPS_INDEX_VIEW_TEMPLATE, \ - GROUPS_CREATE_VIEW_TEMPLATE, GROUPS_UPDATE_VIEW_TEMPLATE, \ - GROUPS_MANAGE_VIEW_TEMPLATE, GROUPS_ADD_MEMBER_VIEW_TEMPLATE, \ - GROUPS_ADD_MEMBER_AJAX_VIEW_TEMPLATE -from .forms import CreateGroupForm, UpdateGroupForm -from .tables import GroupsTable, GroupMembersTable, \ - GroupNonMembersTable + +from .constants import GROUPS_ADD_MEMBER_AJAX_VIEW_TEMPLATE +from .constants import GROUPS_ADD_MEMBER_VIEW_TEMPLATE +from .constants import GROUPS_CREATE_VIEW_TEMPLATE +from .constants import GROUPS_INDEX_URL +from .constants import GROUPS_INDEX_VIEW_TEMPLATE +from .constants import GROUPS_MANAGE_VIEW_TEMPLATE +from .constants import GROUPS_UPDATE_VIEW_TEMPLATE +from .forms import CreateGroupForm +from .forms import UpdateGroupForm +from .tables import GroupMembersTable +from .tables import GroupNonMembersTable +from .tables import GroupsTable class IndexView(tables.DataTableView): diff --git a/openstack_dashboard/dashboards/admin/images/tables.py b/openstack_dashboard/dashboards/admin/images/tables.py index aab22f2382..3ccd3314b4 100644 --- a/openstack_dashboard/dashboards/admin/images/tables.py +++ b/openstack_dashboard/dashboards/admin/images/tables.py @@ -19,8 +19,13 @@ from django.utils.translation import ugettext_lazy as _ from horizon import tables from openstack_dashboard.dashboards.project.images_and_snapshots \ - .images.tables import (ImagesTable, CreateImage, EditImage, - DeleteImage) + .images.tables import CreateImage +from openstack_dashboard.dashboards.project.images_and_snapshots \ + .images.tables import DeleteImage +from openstack_dashboard.dashboards.project.images_and_snapshots \ + .images.tables import EditImage +from openstack_dashboard.dashboards.project.images_and_snapshots \ + .images.tables import ImagesTable class AdminCreateImage(CreateImage): diff --git a/openstack_dashboard/dashboards/admin/images/tests.py b/openstack_dashboard/dashboards/admin/images/tests.py index 0dee4e4969..27cb1f6355 100644 --- a/openstack_dashboard/dashboards/admin/images/tests.py +++ b/openstack_dashboard/dashboards/admin/images/tests.py @@ -14,14 +14,16 @@ # License for the specific language governing permissions and limitations # under the License. -from django import http from django.conf import settings from django.core.urlresolvers import reverse +from django import http from django.test.utils import override_settings + from mox import IsA from openstack_dashboard import api from openstack_dashboard.test import helpers as test + from .tables import AdminImagesTable diff --git a/openstack_dashboard/dashboards/admin/images/urls.py b/openstack_dashboard/dashboards/admin/images/urls.py index b99e7e36bf..87ed2b7a29 100644 --- a/openstack_dashboard/dashboards/admin/images/urls.py +++ b/openstack_dashboard/dashboards/admin/images/urls.py @@ -18,9 +18,13 @@ # License for the specific language governing permissions and limitations # under the License. -from django.conf.urls.defaults import patterns, url +from django.conf.urls.defaults import patterns +from django.conf.urls.defaults import url -from .views import IndexView, CreateView, UpdateView, DetailView +from .views import CreateView +from .views import DetailView +from .views import IndexView +from .views import UpdateView urlpatterns = patterns('openstack_dashboard.dashboards.admin.images.views', diff --git a/openstack_dashboard/dashboards/admin/images/views.py b/openstack_dashboard/dashboards/admin/images/views.py index 2f052507a8..5ac7e4743d 100644 --- a/openstack_dashboard/dashboards/admin/images/views.py +++ b/openstack_dashboard/dashboards/admin/images/views.py @@ -29,8 +29,10 @@ from horizon import tables from openstack_dashboard import api from openstack_dashboard.dashboards.project \ .images_and_snapshots.images import views + +from .forms import AdminCreateImageForm +from .forms import AdminUpdateImageForm from .tables import AdminImagesTable -from .forms import AdminCreateImageForm, AdminUpdateImageForm LOG = logging.getLogger(__name__) diff --git a/openstack_dashboard/dashboards/admin/info/tabs.py b/openstack_dashboard/dashboards/admin/info/tabs.py index 33d9adedb5..c99ea1853c 100644 --- a/openstack_dashboard/dashboards/admin/info/tabs.py +++ b/openstack_dashboard/dashboards/admin/info/tabs.py @@ -21,7 +21,9 @@ from horizon import tabs from openstack_dashboard.api import keystone from openstack_dashboard.usage import quotas -from .tables import QuotasTable, ServicesTable + +from .tables import QuotasTable +from .tables import ServicesTable class DefaultQuotasTab(tabs.TableTab): diff --git a/openstack_dashboard/dashboards/admin/info/tests.py b/openstack_dashboard/dashboards/admin/info/tests.py index 6180bb5a4c..e794d7d4ab 100644 --- a/openstack_dashboard/dashboards/admin/info/tests.py +++ b/openstack_dashboard/dashboards/admin/info/tests.py @@ -14,12 +14,12 @@ # License for the specific language governing permissions and limitations # under the License. -from django import http from django.core.urlresolvers import reverse +from django import http from mox import IsA -from openstack_dashboard.test import helpers as test from openstack_dashboard import api +from openstack_dashboard.test import helpers as test INDEX_URL = reverse('horizon:admin:info:index') diff --git a/openstack_dashboard/dashboards/admin/info/urls.py b/openstack_dashboard/dashboards/admin/info/urls.py index 9c46de826f..11d7218046 100644 --- a/openstack_dashboard/dashboards/admin/info/urls.py +++ b/openstack_dashboard/dashboards/admin/info/urls.py @@ -18,7 +18,8 @@ # License for the specific language governing permissions and limitations # under the License. -from django.conf.urls.defaults import patterns, url +from django.conf.urls.defaults import patterns +from django.conf.urls.defaults import url from .views import IndexView diff --git a/openstack_dashboard/dashboards/admin/instances/tables.py b/openstack_dashboard/dashboards/admin/instances/tables.py index 01364ffd14..ac2b48ef61 100644 --- a/openstack_dashboard/dashboards/admin/instances/tables.py +++ b/openstack_dashboard/dashboards/admin/instances/tables.py @@ -24,13 +24,44 @@ from horizon import tables from horizon.utils.filters import replace_underscores from openstack_dashboard import api -from openstack_dashboard.dashboards.project.instances.tables import ( - TerminateInstance, EditInstance, ConsoleLink, LogLink, CreateSnapshot, - TogglePause, ToggleSuspend, RebootInstance, SoftRebootInstance, - ConfirmResize, RevertResize, get_size, UpdateRow, get_ips, - get_power_state, is_deleting, ACTIVE_STATES, STATUS_DISPLAY_CHOICES, - TASK_DISPLAY_CHOICES) - +from openstack_dashboard.dashboards.project.instances.tables import \ + ACTIVE_STATES +from openstack_dashboard.dashboards.project.instances.tables import \ + ConfirmResize +from openstack_dashboard.dashboards.project.instances.tables import \ + ConsoleLink +from openstack_dashboard.dashboards.project.instances.tables import \ + CreateSnapshot +from openstack_dashboard.dashboards.project.instances.tables import \ + EditInstance +from openstack_dashboard.dashboards.project.instances.tables import \ + get_ips +from openstack_dashboard.dashboards.project.instances.tables import \ + get_power_state +from openstack_dashboard.dashboards.project.instances.tables import \ + get_size +from openstack_dashboard.dashboards.project.instances.tables import \ + is_deleting +from openstack_dashboard.dashboards.project.instances.tables import \ + LogLink +from openstack_dashboard.dashboards.project.instances.tables import \ + RebootInstance +from openstack_dashboard.dashboards.project.instances.tables import \ + RevertResize +from openstack_dashboard.dashboards.project.instances.tables import \ + SoftRebootInstance +from openstack_dashboard.dashboards.project.instances.tables import \ + STATUS_DISPLAY_CHOICES +from openstack_dashboard.dashboards.project.instances.tables import \ + TASK_DISPLAY_CHOICES +from openstack_dashboard.dashboards.project.instances.tables import \ + TerminateInstance +from openstack_dashboard.dashboards.project.instances.tables import \ + TogglePause +from openstack_dashboard.dashboards.project.instances.tables import \ + ToggleSuspend +from openstack_dashboard.dashboards.project.instances.tables import \ + UpdateRow LOG = logging.getLogger(__name__) diff --git a/openstack_dashboard/dashboards/admin/instances/tests.py b/openstack_dashboard/dashboards/admin/instances/tests.py index cdb83c2063..b6d6ee178a 100644 --- a/openstack_dashboard/dashboards/admin/instances/tests.py +++ b/openstack_dashboard/dashboards/admin/instances/tests.py @@ -16,8 +16,8 @@ import uuid -from django import http from django.core.urlresolvers import reverse +from django import http from django.utils.datastructures import SortedDict from mox import IsA diff --git a/openstack_dashboard/dashboards/admin/instances/urls.py b/openstack_dashboard/dashboards/admin/instances/urls.py index bb1df4a77a..adbe4cd481 100644 --- a/openstack_dashboard/dashboards/admin/instances/urls.py +++ b/openstack_dashboard/dashboards/admin/instances/urls.py @@ -18,11 +18,13 @@ # License for the specific language governing permissions and limitations # under the License. -from django.conf.urls.defaults import url, patterns +from django.conf.urls.defaults import patterns +from django.conf.urls.defaults import url -from .views import AdminIndexView, AdminUpdateView from openstack_dashboard.dashboards.project.instances.views import \ DetailView +from .views import AdminIndexView +from .views import AdminUpdateView INSTANCES = r'^(?P[^/]+)/%s$' diff --git a/openstack_dashboard/dashboards/admin/instances/views.py b/openstack_dashboard/dashboards/admin/instances/views.py index dbbbefef23..554643198c 100644 --- a/openstack_dashboard/dashboards/admin/instances/views.py +++ b/openstack_dashboard/dashboards/admin/instances/views.py @@ -31,7 +31,13 @@ from openstack_dashboard import api from openstack_dashboard.dashboards.admin.instances.tables import \ AdminInstancesTable from openstack_dashboard.dashboards.project.instances.views import \ - console as p_console, vnc as p_vnc, spice as p_spice, UpdateView + console as p_console +from openstack_dashboard.dashboards.project.instances.views import \ + spice as p_spice +from openstack_dashboard.dashboards.project.instances.views import \ + UpdateView +from openstack_dashboard.dashboards.project.instances.views import \ + vnc as p_vnc from openstack_dashboard.dashboards.project.instances.workflows.\ update_instance import AdminUpdateInstance diff --git a/openstack_dashboard/dashboards/admin/networks/ports/tables.py b/openstack_dashboard/dashboards/admin/networks/ports/tables.py index e8a356256f..e6e8cb7269 100644 --- a/openstack_dashboard/dashboards/admin/networks/ports/tables.py +++ b/openstack_dashboard/dashboards/admin/networks/ports/tables.py @@ -24,7 +24,9 @@ from horizon import tables from openstack_dashboard import api from openstack_dashboard.dashboards.project.networks.ports.tables import \ - get_fixed_ips, get_attached + get_attached +from openstack_dashboard.dashboards.project.networks.ports.tables import \ + get_fixed_ips LOG = logging.getLogger(__name__) diff --git a/openstack_dashboard/dashboards/admin/networks/ports/urls.py b/openstack_dashboard/dashboards/admin/networks/ports/urls.py index b485427b38..c91ea6b964 100644 --- a/openstack_dashboard/dashboards/admin/networks/ports/urls.py +++ b/openstack_dashboard/dashboards/admin/networks/ports/urls.py @@ -14,7 +14,8 @@ # License for the specific language governing permissions and limitations # under the License. -from django.conf.urls.defaults import patterns, url +from django.conf.urls.defaults import patterns +from django.conf.urls.defaults import url from openstack_dashboard.dashboards.project.networks.ports.views import \ DetailView diff --git a/openstack_dashboard/dashboards/admin/networks/ports/views.py b/openstack_dashboard/dashboards/admin/networks/ports/views.py index 384670d36c..5631cf09f7 100644 --- a/openstack_dashboard/dashboards/admin/networks/ports/views.py +++ b/openstack_dashboard/dashboards/admin/networks/ports/views.py @@ -26,7 +26,8 @@ from openstack_dashboard import api from openstack_dashboard.dashboards.project.networks.ports \ import views as project_views -from .forms import CreatePort, UpdatePort +from .forms import CreatePort +from .forms import UpdatePort LOG = logging.getLogger(__name__) diff --git a/openstack_dashboard/dashboards/admin/networks/subnets/urls.py b/openstack_dashboard/dashboards/admin/networks/subnets/urls.py index 6af5d626ca..3779372da5 100644 --- a/openstack_dashboard/dashboards/admin/networks/subnets/urls.py +++ b/openstack_dashboard/dashboards/admin/networks/subnets/urls.py @@ -14,7 +14,8 @@ # License for the specific language governing permissions and limitations # under the License. -from django.conf.urls.defaults import patterns, url +from django.conf.urls.defaults import patterns +from django.conf.urls.defaults import url from openstack_dashboard.dashboards.project.networks.subnets.views import \ DetailView diff --git a/openstack_dashboard/dashboards/admin/networks/subnets/views.py b/openstack_dashboard/dashboards/admin/networks/subnets/views.py index 8a54320692..2ee3f64c9a 100644 --- a/openstack_dashboard/dashboards/admin/networks/subnets/views.py +++ b/openstack_dashboard/dashboards/admin/networks/subnets/views.py @@ -19,7 +19,8 @@ import logging from openstack_dashboard.dashboards.project.networks.subnets \ import views as project_views -from .workflows import CreateSubnet, UpdateSubnet +from .workflows import CreateSubnet +from .workflows import UpdateSubnet LOG = logging.getLogger(__name__) diff --git a/openstack_dashboard/dashboards/admin/networks/tests.py b/openstack_dashboard/dashboards/admin/networks/tests.py index 9c2cd19918..cb72e6b34a 100644 --- a/openstack_dashboard/dashboards/admin/networks/tests.py +++ b/openstack_dashboard/dashboards/admin/networks/tests.py @@ -14,16 +14,17 @@ # License for the specific language governing permissions and limitations # under the License. -from django import http from django.core.urlresolvers import reverse +from django import http + +from horizon.workflows.views import WorkflowView from mox import IsA from openstack_dashboard import api -from openstack_dashboard.test import helpers as test from openstack_dashboard.dashboards.project.networks.tests \ import form_data_subnet -from horizon.workflows.views import WorkflowView +from openstack_dashboard.test import helpers as test INDEX_URL = reverse('horizon:admin:networks:index') diff --git a/openstack_dashboard/dashboards/admin/networks/urls.py b/openstack_dashboard/dashboards/admin/networks/urls.py index 59387d8861..423a9042ab 100644 --- a/openstack_dashboard/dashboards/admin/networks/urls.py +++ b/openstack_dashboard/dashboards/admin/networks/urls.py @@ -14,16 +14,22 @@ # License for the specific language governing permissions and limitations # under the License. -from django.conf.urls.defaults import patterns, url, include -from .views import IndexView, CreateView, DetailView, UpdateView +from django.conf.urls.defaults import include +from django.conf.urls.defaults import patterns +from django.conf.urls.defaults import url -from .subnets.views import CreateView as AddSubnetView -from .subnets.views import UpdateView as EditSubnetView -from .ports.views import CreateView as AddPortView -from .ports.views import UpdateView as EditPortView +from .views import CreateView +from .views import DetailView +from .views import IndexView +from .views import UpdateView from .subnets import urls as subnet_urls +from .subnets.views import CreateView as AddSubnetView +from .subnets.views import UpdateView as EditSubnetView + from .ports import urls as port_urls +from .ports.views import CreateView as AddPortView +from .ports.views import UpdateView as EditPortView NETWORKS = r'^(?P[^/]+)/%s$' diff --git a/openstack_dashboard/dashboards/admin/networks/views.py b/openstack_dashboard/dashboards/admin/networks/views.py index bb7d96e916..48efa9031b 100644 --- a/openstack_dashboard/dashboards/admin/networks/views.py +++ b/openstack_dashboard/dashboards/admin/networks/views.py @@ -17,8 +17,8 @@ import logging from django.core.urlresolvers import reverse_lazy -from django.utils.translation import ugettext_lazy as _ from django.utils.datastructures import SortedDict +from django.utils.translation import ugettext_lazy as _ from horizon import exceptions from horizon import forms @@ -26,10 +26,12 @@ from horizon import tables from openstack_dashboard import api from openstack_dashboard.dashboards.project.networks import views as user_views -from .tables import NetworksTable -from .subnets.tables import SubnetsTable + +from .forms import CreateNetwork +from .forms import UpdateNetwork from .ports.tables import PortsTable -from .forms import CreateNetwork, UpdateNetwork +from .subnets.tables import SubnetsTable +from .tables import NetworksTable LOG = logging.getLogger(__name__) diff --git a/openstack_dashboard/dashboards/admin/overview/tests.py b/openstack_dashboard/dashboards/admin/overview/tests.py index 2b272f1c82..965292ab11 100644 --- a/openstack_dashboard/dashboards/admin/overview/tests.py +++ b/openstack_dashboard/dashboards/admin/overview/tests.py @@ -20,17 +20,18 @@ import datetime -from django import http from django.core.urlresolvers import reverse +from django import http from django.utils import timezone -from mox import IsA, Func +from mox import Func +from mox import IsA from horizon.templatetags.sizeformat import mbformat from openstack_dashboard import api -from openstack_dashboard import usage from openstack_dashboard.test import helpers as test +from openstack_dashboard import usage INDEX_URL = reverse('horizon:project:overview:index') diff --git a/openstack_dashboard/dashboards/admin/overview/urls.py b/openstack_dashboard/dashboards/admin/overview/urls.py index 7aca2a477e..e973af47ae 100644 --- a/openstack_dashboard/dashboards/admin/overview/urls.py +++ b/openstack_dashboard/dashboards/admin/overview/urls.py @@ -19,7 +19,8 @@ # under the License. -from django.conf.urls.defaults import url, patterns +from django.conf.urls.defaults import patterns +from django.conf.urls.defaults import url from .views import GlobalOverview diff --git a/openstack_dashboard/dashboards/admin/projects/tables.py b/openstack_dashboard/dashboards/admin/projects/tables.py index 694193fc50..cfde24a457 100644 --- a/openstack_dashboard/dashboards/admin/projects/tables.py +++ b/openstack_dashboard/dashboards/admin/projects/tables.py @@ -1,13 +1,14 @@ import logging from django.core.urlresolvers import reverse -from django.utils.translation import ugettext_lazy as _ from django.utils.http import urlencode +from django.utils.translation import ugettext_lazy as _ from horizon import exceptions from horizon import tables from openstack_dashboard import api + from ..users.tables import UsersTable diff --git a/openstack_dashboard/dashboards/admin/projects/tests.py b/openstack_dashboard/dashboards/admin/projects/tests.py index a40783030d..631c7f957b 100644 --- a/openstack_dashboard/dashboards/admin/projects/tests.py +++ b/openstack_dashboard/dashboards/admin/projects/tests.py @@ -16,18 +16,21 @@ import logging -from django import http from django.core.urlresolvers import reverse +from django import http from mox import IsA from horizon import exceptions +from horizon.workflows.views import WorkflowView from openstack_dashboard import api from openstack_dashboard.test import helpers as test from openstack_dashboard.usage import quotas -from .workflows import CreateProject, UpdateProject -from horizon.workflows.views import WorkflowView + +from .workflows import CreateProject +from .workflows import UpdateProject + INDEX_URL = reverse('horizon:admin:projects:index') diff --git a/openstack_dashboard/dashboards/admin/projects/urls.py b/openstack_dashboard/dashboards/admin/projects/urls.py index 59369302c9..02f84b687a 100644 --- a/openstack_dashboard/dashboards/admin/projects/urls.py +++ b/openstack_dashboard/dashboards/admin/projects/urls.py @@ -18,11 +18,14 @@ # License for the specific language governing permissions and limitations # under the License. -from django.conf.urls.defaults import patterns, url +from django.conf.urls.defaults import patterns +from django.conf.urls.defaults import url -from .views import (IndexView, TenantUsageView, - CreateProjectView, UpdateProjectView, - CreateUserView) +from .views import CreateProjectView +from .views import CreateUserView +from .views import IndexView +from .views import TenantUsageView +from .views import UpdateProjectView urlpatterns = patterns('', diff --git a/openstack_dashboard/dashboards/admin/projects/views.py b/openstack_dashboard/dashboards/admin/projects/views.py index 2f03d24981..8650f2cb4d 100644 --- a/openstack_dashboard/dashboards/admin/projects/views.py +++ b/openstack_dashboard/dashboards/admin/projects/views.py @@ -20,7 +20,8 @@ import logging -from django.core.urlresolvers import reverse, reverse_lazy +from django.core.urlresolvers import reverse +from django.core.urlresolvers import reverse_lazy from django.utils.translation import ugettext_lazy as _ from horizon import exceptions @@ -28,12 +29,16 @@ from horizon import tables from horizon import workflows from openstack_dashboard import api +from openstack_dashboard.dashboards.admin.users.views import CreateView from openstack_dashboard import usage from openstack_dashboard.usage import quotas -from openstack_dashboard.dashboards.admin.users.views import CreateView + from .forms import CreateUser -from .tables import TenantsTable, TenantUsersTable, AddUsersTable -from .workflows import CreateProject, UpdateProject +from .tables import AddUsersTable +from .tables import TenantsTable +from .tables import TenantUsersTable +from .workflows import CreateProject +from .workflows import UpdateProject LOG = logging.getLogger(__name__) diff --git a/openstack_dashboard/dashboards/admin/projects/workflows.py b/openstack_dashboard/dashboards/admin/projects/workflows.py index b9b39812c0..bbe10dd179 100644 --- a/openstack_dashboard/dashboards/admin/projects/workflows.py +++ b/openstack_dashboard/dashboards/admin/projects/workflows.py @@ -20,21 +20,22 @@ from django.conf import settings -from django.utils.translation import ugettext_lazy as _ from django.core.urlresolvers import reverse +from django.utils.translation import ugettext_lazy as _ from horizon import exceptions -from horizon import workflows from horizon import forms from horizon import messages +from horizon import workflows from openstack_dashboard import api -from openstack_dashboard.api import cinder, nova from openstack_dashboard.api.base import is_service_enabled -from openstack_dashboard.usage.quotas import (NOVA_QUOTA_FIELDS, - CINDER_QUOTA_FIELDS, - QUOTA_FIELDS, - get_disabled_quotas) +from openstack_dashboard.api import cinder +from openstack_dashboard.api import nova +from openstack_dashboard.usage.quotas import CINDER_QUOTA_FIELDS +from openstack_dashboard.usage.quotas import get_disabled_quotas +from openstack_dashboard.usage.quotas import NOVA_QUOTA_FIELDS +from openstack_dashboard.usage.quotas import QUOTA_FIELDS INDEX_URL = "horizon:admin:projects:index" ADD_USER_URL = "horizon:admin:projects:create_user" diff --git a/openstack_dashboard/dashboards/admin/roles/tests.py b/openstack_dashboard/dashboards/admin/roles/tests.py index f4f5db84be..c97a528b81 100644 --- a/openstack_dashboard/dashboards/admin/roles/tests.py +++ b/openstack_dashboard/dashboards/admin/roles/tests.py @@ -14,10 +14,11 @@ # License for the specific language governing permissions and limitations # under the License. -from django import http from django.core.urlresolvers import reverse +from django import http -from mox import IgnoreArg, IsA +from mox import IgnoreArg +from mox import IsA from openstack_dashboard import api from openstack_dashboard.test import helpers as test diff --git a/openstack_dashboard/dashboards/admin/roles/urls.py b/openstack_dashboard/dashboards/admin/roles/urls.py index 333cf2ea91..bbcb8fc0b5 100644 --- a/openstack_dashboard/dashboards/admin/roles/urls.py +++ b/openstack_dashboard/dashboards/admin/roles/urls.py @@ -14,9 +14,12 @@ # License for the specific language governing permissions and limitations # under the License. -from django.conf.urls.defaults import patterns, url +from django.conf.urls.defaults import patterns +from django.conf.urls.defaults import url -from .views import IndexView, CreateView, UpdateView +from .views import CreateView +from .views import IndexView +from .views import UpdateView urlpatterns = patterns('openstack_dashboard.dashboards.admin.roles.views', url(r'^$', IndexView.as_view(), name='index'), diff --git a/openstack_dashboard/dashboards/admin/roles/views.py b/openstack_dashboard/dashboards/admin/roles/views.py index 42e81b21b0..a4958e2584 100644 --- a/openstack_dashboard/dashboards/admin/roles/views.py +++ b/openstack_dashboard/dashboards/admin/roles/views.py @@ -14,7 +14,8 @@ # License for the specific language governing permissions and limitations # under the License. -from django.core.urlresolvers import reverse, reverse_lazy +from django.core.urlresolvers import reverse +from django.core.urlresolvers import reverse_lazy from django.utils.translation import ugettext_lazy as _ from horizon import exceptions @@ -22,7 +23,9 @@ from horizon import forms from horizon import tables from openstack_dashboard import api -from .forms import CreateRoleForm, UpdateRoleForm + +from .forms import CreateRoleForm +from .forms import UpdateRoleForm from .tables import RolesTable diff --git a/openstack_dashboard/dashboards/admin/routers/ports/urls.py b/openstack_dashboard/dashboards/admin/routers/ports/urls.py index 1618bc14e7..48f2be3be1 100644 --- a/openstack_dashboard/dashboards/admin/routers/ports/urls.py +++ b/openstack_dashboard/dashboards/admin/routers/ports/urls.py @@ -14,7 +14,8 @@ # License for the specific language governing permissions and limitations # under the License. -from django.conf.urls.defaults import patterns, url +from django.conf.urls.defaults import patterns +from django.conf.urls.defaults import url from .views import DetailView diff --git a/openstack_dashboard/dashboards/admin/routers/ports/views.py b/openstack_dashboard/dashboards/admin/routers/ports/views.py index 5d119d7917..1532b70aff 100644 --- a/openstack_dashboard/dashboards/admin/routers/ports/views.py +++ b/openstack_dashboard/dashboards/admin/routers/ports/views.py @@ -17,6 +17,7 @@ import logging from horizon import tabs + from .tabs import PortDetailTabs diff --git a/openstack_dashboard/dashboards/admin/routers/tests.py b/openstack_dashboard/dashboards/admin/routers/tests.py index a48c9fc413..9ee3c5d445 100644 --- a/openstack_dashboard/dashboards/admin/routers/tests.py +++ b/openstack_dashboard/dashboards/admin/routers/tests.py @@ -13,9 +13,11 @@ # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. -from mox import IsA -from django import http + from django.core.urlresolvers import reverse +from django import http + +from mox import IsA from openstack_dashboard import api from openstack_dashboard.dashboards.project.routers import tests as r_test diff --git a/openstack_dashboard/dashboards/admin/routers/urls.py b/openstack_dashboard/dashboards/admin/routers/urls.py index acea94cf8f..8666c8158d 100644 --- a/openstack_dashboard/dashboards/admin/routers/urls.py +++ b/openstack_dashboard/dashboards/admin/routers/urls.py @@ -14,9 +14,11 @@ # License for the specific language governing permissions and limitations # under the License. -from django.conf.urls.defaults import patterns, url +from django.conf.urls.defaults import patterns +from django.conf.urls.defaults import url -from .views import (IndexView, DetailView) +from .views import DetailView +from .views import IndexView urlpatterns = patterns('horizon.dashboards.admin.routers.views', diff --git a/openstack_dashboard/dashboards/admin/users/tests.py b/openstack_dashboard/dashboards/admin/users/tests.py index aefe6077fa..848785c94e 100644 --- a/openstack_dashboard/dashboards/admin/users/tests.py +++ b/openstack_dashboard/dashboards/admin/users/tests.py @@ -20,10 +20,11 @@ from socket import timeout as socket_timeout -from django import http from django.core.urlresolvers import reverse +from django import http -from mox import IgnoreArg, IsA +from mox import IgnoreArg +from mox import IsA from openstack_dashboard import api from openstack_dashboard.test import helpers as test diff --git a/openstack_dashboard/dashboards/admin/users/urls.py b/openstack_dashboard/dashboards/admin/users/urls.py index 7daf96933a..5aa4e20d52 100644 --- a/openstack_dashboard/dashboards/admin/users/urls.py +++ b/openstack_dashboard/dashboards/admin/users/urls.py @@ -18,9 +18,12 @@ # License for the specific language governing permissions and limitations # under the License. -from django.conf.urls.defaults import patterns, url +from django.conf.urls.defaults import patterns +from django.conf.urls.defaults import url -from .views import IndexView, CreateView, UpdateView +from .views import CreateView +from .views import IndexView +from .views import UpdateView urlpatterns = patterns('openstack_dashboard.dashboards.admin.users.views', url(r'^$', IndexView.as_view(), name='index'), diff --git a/openstack_dashboard/dashboards/admin/users/views.py b/openstack_dashboard/dashboards/admin/users/views.py index 5856e2a4e9..8836f3bda4 100644 --- a/openstack_dashboard/dashboards/admin/users/views.py +++ b/openstack_dashboard/dashboards/admin/users/views.py @@ -20,7 +20,8 @@ import operator -from django.core.urlresolvers import reverse, reverse_lazy +from django.core.urlresolvers import reverse +from django.core.urlresolvers import reverse_lazy from django.utils.decorators import method_decorator from django.utils.translation import ugettext_lazy as _ from django.views.decorators.debug import sensitive_post_parameters @@ -30,7 +31,9 @@ from horizon import forms from horizon import tables from openstack_dashboard import api -from .forms import CreateUserForm, UpdateUserForm + +from .forms import CreateUserForm +from .forms import UpdateUserForm from .tables import UsersTable diff --git a/openstack_dashboard/dashboards/admin/volumes/tables.py b/openstack_dashboard/dashboards/admin/volumes/tables.py index 642c644604..eb67d44e63 100644 --- a/openstack_dashboard/dashboards/admin/volumes/tables.py +++ b/openstack_dashboard/dashboards/admin/volumes/tables.py @@ -2,8 +2,12 @@ from django.utils.translation import ugettext_lazy as _ from horizon import tables from openstack_dashboard.api import cinder -from openstack_dashboard.dashboards.project.volumes.tables import (UpdateRow, - VolumesTable as _VolumesTable, DeleteVolume) +from openstack_dashboard.dashboards.project.volumes.tables import \ + DeleteVolume +from openstack_dashboard.dashboards.project.volumes.tables import \ + UpdateRow +from openstack_dashboard.dashboards.project.volumes.tables import \ + VolumesTable as _VolumesTable class CreateVolumeType(tables.LinkAction): diff --git a/openstack_dashboard/dashboards/admin/volumes/tests.py b/openstack_dashboard/dashboards/admin/volumes/tests.py index b2c829f2c9..541de180fa 100644 --- a/openstack_dashboard/dashboards/admin/volumes/tests.py +++ b/openstack_dashboard/dashboards/admin/volumes/tests.py @@ -14,8 +14,8 @@ # License for the specific language governing permissions and limitations # under the License. -from django import http from django.core.urlresolvers import reverse +from django import http from mox import IsA from openstack_dashboard import api diff --git a/openstack_dashboard/dashboards/admin/volumes/urls.py b/openstack_dashboard/dashboards/admin/volumes/urls.py index 5c0280cb5d..6eed1c5b6d 100644 --- a/openstack_dashboard/dashboards/admin/volumes/urls.py +++ b/openstack_dashboard/dashboards/admin/volumes/urls.py @@ -1,6 +1,9 @@ -from django.conf.urls.defaults import patterns, url +from django.conf.urls.defaults import patterns +from django.conf.urls.defaults import url -from .views import IndexView, DetailView, CreateVolumeTypeView +from .views import CreateVolumeTypeView +from .views import DetailView +from .views import IndexView urlpatterns = patterns('', url(r'^$', IndexView.as_view(), name='index'), diff --git a/openstack_dashboard/dashboards/admin/volumes/views.py b/openstack_dashboard/dashboards/admin/volumes/views.py index 92e9097dff..bf566652eb 100644 --- a/openstack_dashboard/dashboards/admin/volumes/views.py +++ b/openstack_dashboard/dashboards/admin/volumes/views.py @@ -18,16 +18,22 @@ Admin views for managing volumes. """ +from django.core.urlresolvers import reverse from django.utils.datastructures import SortedDict from django.utils.translation import ugettext_lazy as _ -from django.core.urlresolvers import reverse + from openstack_dashboard.dashboards.project.volumes.views import \ - VolumeTableMixIn, DetailView as _DetailView + DetailView as _DetailView +from openstack_dashboard.dashboards.project.volumes.views import \ + VolumeTableMixIn + from openstack_dashboard.api import cinder from openstack_dashboard.api import keystone -from .tables import VolumesTable, VolumeTypesTable from .forms import CreateVolumeType +from .tables import VolumesTable +from .tables import VolumeTypesTable + from horizon import exceptions from horizon import forms from horizon import tables diff --git a/openstack_dashboard/dashboards/project/access_and_security/api_access/tables.py b/openstack_dashboard/dashboards/project/access_and_security/api_access/tables.py index eeb372ce34..dc520cba2d 100644 --- a/openstack_dashboard/dashboards/project/access_and_security/api_access/tables.py +++ b/openstack_dashboard/dashboards/project/access_and_security/api_access/tables.py @@ -14,8 +14,8 @@ # License for the specific language governing permissions and limitations # under the License. -from django.utils.translation import ugettext_lazy as _ from django.template.defaultfilters import title +from django.utils.translation import ugettext_lazy as _ from horizon import tables diff --git a/openstack_dashboard/dashboards/project/access_and_security/api_access/tests.py b/openstack_dashboard/dashboards/project/access_and_security/api_access/tests.py index 29cbc2c970..a01a077541 100644 --- a/openstack_dashboard/dashboards/project/access_and_security/api_access/tests.py +++ b/openstack_dashboard/dashboards/project/access_and_security/api_access/tests.py @@ -14,8 +14,8 @@ # License for the specific language governing permissions and limitations # under the License. -from django.http import HttpRequest from django.core.urlresolvers import reverse +from django.http import HttpRequest from mox import IsA diff --git a/openstack_dashboard/dashboards/project/access_and_security/api_access/urls.py b/openstack_dashboard/dashboards/project/access_and_security/api_access/urls.py index e6e829e1ec..84f9b17da1 100644 --- a/openstack_dashboard/dashboards/project/access_and_security/api_access/urls.py +++ b/openstack_dashboard/dashboards/project/access_and_security/api_access/urls.py @@ -18,9 +18,11 @@ # License for the specific language governing permissions and limitations # under the License. -from django.conf.urls.defaults import patterns, url +from django.conf.urls.defaults import patterns +from django.conf.urls.defaults import url -from .views import download_ec2_bundle, download_rc_file +from .views import download_ec2_bundle +from .views import download_rc_file urlpatterns = patterns('', diff --git a/openstack_dashboard/dashboards/project/access_and_security/api_access/views.py b/openstack_dashboard/dashboards/project/access_and_security/api_access/views.py index c06d1831f5..9270b3b45c 100644 --- a/openstack_dashboard/dashboards/project/access_and_security/api_access/views.py +++ b/openstack_dashboard/dashboards/project/access_and_security/api_access/views.py @@ -14,10 +14,10 @@ # License for the specific language governing permissions and limitations # under the License. +from contextlib import closing import logging import tempfile import zipfile -from contextlib import closing from django import http from django import shortcuts diff --git a/openstack_dashboard/dashboards/project/access_and_security/floating_ips/tables.py b/openstack_dashboard/dashboards/project/access_and_security/floating_ips/tables.py index ea95797bfe..bc097f049a 100644 --- a/openstack_dashboard/dashboards/project/access_and_security/floating_ips/tables.py +++ b/openstack_dashboard/dashboards/project/access_and_security/floating_ips/tables.py @@ -17,8 +17,8 @@ import logging -from django import shortcuts from django.core import urlresolvers +from django import shortcuts from django.utils.http import urlencode from django.utils.translation import ugettext_lazy as _ diff --git a/openstack_dashboard/dashboards/project/access_and_security/floating_ips/tests.py b/openstack_dashboard/dashboards/project/access_and_security/floating_ips/tests.py index fa1dbfde01..552381543a 100644 --- a/openstack_dashboard/dashboards/project/access_and_security/floating_ips/tests.py +++ b/openstack_dashboard/dashboards/project/access_and_security/floating_ips/tests.py @@ -21,8 +21,8 @@ import uuid -from django import http from django.core.urlresolvers import reverse +from django import http from mox import IsA @@ -30,6 +30,7 @@ from openstack_dashboard import api from openstack_dashboard.test import helpers as test from .utils import get_int_or_uuid + from horizon.workflows.views import WorkflowView diff --git a/openstack_dashboard/dashboards/project/access_and_security/floating_ips/urls.py b/openstack_dashboard/dashboards/project/access_and_security/floating_ips/urls.py index cc8da951a3..959597f575 100644 --- a/openstack_dashboard/dashboards/project/access_and_security/floating_ips/urls.py +++ b/openstack_dashboard/dashboards/project/access_and_security/floating_ips/urls.py @@ -18,9 +18,11 @@ # License for the specific language governing permissions and limitations # under the License. -from django.conf.urls.defaults import patterns, url +from django.conf.urls.defaults import patterns +from django.conf.urls.defaults import url -from .views import AssociateView, AllocateView +from .views import AllocateView +from .views import AssociateView urlpatterns = patterns('', diff --git a/openstack_dashboard/dashboards/project/access_and_security/floating_ips/views.py b/openstack_dashboard/dashboards/project/access_and_security/floating_ips/views.py index 547b45b2b3..9549499ce1 100644 --- a/openstack_dashboard/dashboards/project/access_and_security/floating_ips/views.py +++ b/openstack_dashboard/dashboards/project/access_and_security/floating_ips/views.py @@ -32,6 +32,7 @@ from horizon import workflows from openstack_dashboard import api from openstack_dashboard.usage import quotas + from .forms import FloatingIpAllocate from .workflows import IPAssociationWorkflow diff --git a/openstack_dashboard/dashboards/project/access_and_security/floating_ips/workflows.py b/openstack_dashboard/dashboards/project/access_and_security/floating_ips/workflows.py index 82b34072fe..508a34fa98 100644 --- a/openstack_dashboard/dashboards/project/access_and_security/floating_ips/workflows.py +++ b/openstack_dashboard/dashboards/project/access_and_security/floating_ips/workflows.py @@ -19,8 +19,8 @@ from django.core.urlresolvers import reverse from django.utils.translation import ugettext_lazy as _ from horizon import exceptions -from horizon import workflows from horizon import forms +from horizon import workflows from openstack_dashboard import api diff --git a/openstack_dashboard/dashboards/project/access_and_security/keypairs/tests.py b/openstack_dashboard/dashboards/project/access_and_security/keypairs/tests.py index 7fccfbfa8d..bdb12452d2 100644 --- a/openstack_dashboard/dashboards/project/access_and_security/keypairs/tests.py +++ b/openstack_dashboard/dashboards/project/access_and_security/keypairs/tests.py @@ -18,8 +18,8 @@ # License for the specific language governing permissions and limitations # under the License. -from django import http from django.core.urlresolvers import reverse +from django import http from mox import IsA diff --git a/openstack_dashboard/dashboards/project/access_and_security/keypairs/urls.py b/openstack_dashboard/dashboards/project/access_and_security/keypairs/urls.py index 50886b2054..0d301c4c45 100644 --- a/openstack_dashboard/dashboards/project/access_and_security/keypairs/urls.py +++ b/openstack_dashboard/dashboards/project/access_and_security/keypairs/urls.py @@ -18,9 +18,13 @@ # License for the specific language governing permissions and limitations # under the License. -from django.conf.urls.defaults import patterns, url +from django.conf.urls.defaults import patterns +from django.conf.urls.defaults import url -from .views import CreateView, ImportView, DownloadView, GenerateView +from .views import CreateView +from .views import DownloadView +from .views import GenerateView +from .views import ImportView urlpatterns = patterns('', diff --git a/openstack_dashboard/dashboards/project/access_and_security/keypairs/views.py b/openstack_dashboard/dashboards/project/access_and_security/keypairs/views.py index 1554bb07fe..5cf962c0a2 100644 --- a/openstack_dashboard/dashboards/project/access_and_security/keypairs/views.py +++ b/openstack_dashboard/dashboards/project/access_and_security/keypairs/views.py @@ -23,17 +23,21 @@ Views for managing keypairs. """ import logging +from django.core.urlresolvers import reverse +from django.core.urlresolvers import reverse_lazy from django import http -from django.core.urlresolvers import reverse, reverse_lazy from django.template.defaultfilters import slugify -from django.views.generic import View, TemplateView from django.utils.translation import ugettext_lazy as _ +from django.views.generic import TemplateView +from django.views.generic import View -from horizon import forms from horizon import exceptions +from horizon import forms from openstack_dashboard import api -from .forms import CreateKeypair, ImportKeypair + +from .forms import CreateKeypair +from .forms import ImportKeypair LOG = logging.getLogger(__name__) diff --git a/openstack_dashboard/dashboards/project/access_and_security/security_groups/forms.py b/openstack_dashboard/dashboards/project/access_and_security/security_groups/forms.py index 5a629574cd..64fce6d050 100644 --- a/openstack_dashboard/dashboards/project/access_and_security/security_groups/forms.py +++ b/openstack_dashboard/dashboards/project/access_and_security/security_groups/forms.py @@ -18,19 +18,20 @@ # License for the specific language governing permissions and limitations # under the License. -from django.core import validators +from django.conf import settings from django.core.urlresolvers import reverse +from django.core import validators from django.forms import ValidationError from django.utils.translation import ugettext_lazy as _ -from django.conf import settings from horizon import exceptions from horizon import forms from horizon import messages -from horizon.utils.validators import validate_port_range from horizon.utils import fields +from horizon.utils.validators import validate_port_range from openstack_dashboard import api + from ..floating_ips.utils import get_int_or_uuid diff --git a/openstack_dashboard/dashboards/project/access_and_security/security_groups/tables.py b/openstack_dashboard/dashboards/project/access_and_security/security_groups/tables.py index 2f69e80c7c..27633f53dc 100644 --- a/openstack_dashboard/dashboards/project/access_and_security/security_groups/tables.py +++ b/openstack_dashboard/dashboards/project/access_and_security/security_groups/tables.py @@ -16,13 +16,14 @@ import logging +from django.conf import settings from django.core.urlresolvers import reverse from django.utils.translation import ugettext_lazy as _ -from django.conf import settings from horizon import tables from openstack_dashboard import api + from ..floating_ips.utils import get_int_or_uuid diff --git a/openstack_dashboard/dashboards/project/access_and_security/security_groups/tests.py b/openstack_dashboard/dashboards/project/access_and_security/security_groups/tests.py index ced1c56937..696dc65ba4 100644 --- a/openstack_dashboard/dashboards/project/access_and_security/security_groups/tests.py +++ b/openstack_dashboard/dashboards/project/access_and_security/security_groups/tests.py @@ -18,15 +18,17 @@ # License for the specific language governing permissions and limitations # under the License. -from django import http from django.conf import settings from django.core.urlresolvers import reverse +from django import http from mox import IsA from openstack_dashboard import api from openstack_dashboard.test import helpers as test -from .tables import SecurityGroupsTable, RulesTable + +from .tables import RulesTable +from .tables import SecurityGroupsTable INDEX_URL = reverse('horizon:project:access_and_security:index') diff --git a/openstack_dashboard/dashboards/project/access_and_security/security_groups/urls.py b/openstack_dashboard/dashboards/project/access_and_security/security_groups/urls.py index 2f2703f247..ce0f3ce502 100644 --- a/openstack_dashboard/dashboards/project/access_and_security/security_groups/urls.py +++ b/openstack_dashboard/dashboards/project/access_and_security/security_groups/urls.py @@ -18,9 +18,12 @@ # License for the specific language governing permissions and limitations # under the License. -from django.conf.urls.defaults import patterns, url +from django.conf.urls.defaults import patterns +from django.conf.urls.defaults import url -from .views import CreateView, DetailView, AddRuleView +from .views import AddRuleView +from .views import CreateView +from .views import DetailView urlpatterns = patterns('', diff --git a/openstack_dashboard/dashboards/project/access_and_security/security_groups/views.py b/openstack_dashboard/dashboards/project/access_and_security/security_groups/views.py index bc1834a0ad..74a764e324 100644 --- a/openstack_dashboard/dashboards/project/access_and_security/security_groups/views.py +++ b/openstack_dashboard/dashboards/project/access_and_security/security_groups/views.py @@ -23,7 +23,8 @@ Views for managing instances. """ import logging -from django.core.urlresolvers import reverse_lazy, reverse +from django.core.urlresolvers import reverse +from django.core.urlresolvers import reverse_lazy from django.utils.translation import ugettext_lazy as _ from horizon import exceptions @@ -31,8 +32,10 @@ from horizon import forms from horizon import tables from openstack_dashboard import api + from ..floating_ips.utils import get_int_or_uuid -from .forms import CreateGroup, AddRule +from .forms import AddRule +from .forms import CreateGroup from .tables import RulesTable diff --git a/openstack_dashboard/dashboards/project/access_and_security/tabs.py b/openstack_dashboard/dashboards/project/access_and_security/tabs.py index 54cdc4ff70..90420bac2f 100644 --- a/openstack_dashboard/dashboards/project/access_and_security/tabs.py +++ b/openstack_dashboard/dashboards/project/access_and_security/tabs.py @@ -29,10 +29,10 @@ from openstack_dashboard.api import keystone from openstack_dashboard.api import network from openstack_dashboard.api import nova -from .keypairs.tables import KeypairsTable -from .floating_ips.tables import FloatingIPsTable -from .security_groups.tables import SecurityGroupsTable from .api_access.tables import EndpointsTable +from .floating_ips.tables import FloatingIPsTable +from .keypairs.tables import KeypairsTable +from .security_groups.tables import SecurityGroupsTable class SecurityGroupsTab(tabs.TableTab): diff --git a/openstack_dashboard/dashboards/project/access_and_security/tests.py b/openstack_dashboard/dashboards/project/access_and_security/tests.py index ffab89a637..2798d06f13 100644 --- a/openstack_dashboard/dashboards/project/access_and_security/tests.py +++ b/openstack_dashboard/dashboards/project/access_and_security/tests.py @@ -20,14 +20,15 @@ from copy import deepcopy -from django import http from django.core.urlresolvers import reverse +from django import http from mox import IsA +from horizon.workflows.views import WorkflowView + from openstack_dashboard import api from openstack_dashboard.test import helpers as test -from horizon.workflows.views import WorkflowView class AccessAndSecurityTests(test.TestCase): diff --git a/openstack_dashboard/dashboards/project/access_and_security/urls.py b/openstack_dashboard/dashboards/project/access_and_security/urls.py index cc587394a3..5a511a7a7d 100644 --- a/openstack_dashboard/dashboards/project/access_and_security/urls.py +++ b/openstack_dashboard/dashboards/project/access_and_security/urls.py @@ -18,7 +18,9 @@ # License for the specific language governing permissions and limitations # under the License. -from django.conf.urls.defaults import url, patterns, include +from django.conf.urls.defaults import include +from django.conf.urls.defaults import patterns +from django.conf.urls.defaults import url from .api_access import urls as api_access_urls from .floating_ips import urls as fip_urls diff --git a/openstack_dashboard/dashboards/project/containers/browsers.py b/openstack_dashboard/dashboards/project/containers/browsers.py index eaf5b9c92e..8a5174c55b 100644 --- a/openstack_dashboard/dashboards/project/containers/browsers.py +++ b/openstack_dashboard/dashboards/project/containers/browsers.py @@ -18,7 +18,10 @@ from django.utils.translation import ugettext_lazy as _ from horizon import browsers -from .tables import ContainersTable, ObjectsTable +from openstack_dashboard.dashboards.project.containers.tables import \ + ContainersTable +from openstack_dashboard.dashboards.project.containers.tables import \ + ObjectsTable class ContainerBrowser(browsers.ResourceBrowser): diff --git a/openstack_dashboard/dashboards/project/containers/forms.py b/openstack_dashboard/dashboards/project/containers/forms.py index 5e38c12be9..50fe259a8d 100644 --- a/openstack_dashboard/dashboards/project/containers/forms.py +++ b/openstack_dashboard/dashboards/project/containers/forms.py @@ -20,8 +20,8 @@ import logging -from django.core import validators from django.core.urlresolvers import reverse +from django.core import validators from django.utils.translation import ugettext_lazy as _ from horizon import exceptions @@ -29,7 +29,8 @@ from horizon import forms from horizon import messages from openstack_dashboard import api -from .tables import wrap_delimiter +from openstack_dashboard.dashboards.project.containers.tables import \ + wrap_delimiter LOG = logging.getLogger(__name__) diff --git a/openstack_dashboard/dashboards/project/containers/tests.py b/openstack_dashboard/dashboards/project/containers/tests.py index bd5cf9f166..193bb0e0c5 100644 --- a/openstack_dashboard/dashboards/project/containers/tests.py +++ b/openstack_dashboard/dashboards/project/containers/tests.py @@ -20,16 +20,21 @@ import tempfile -from django import http from django.core.files.uploadedfile import InMemoryUploadedFile from django.core.urlresolvers import reverse +from django import http from mox import IsA from openstack_dashboard import api +from openstack_dashboard.dashboards.project.containers import forms +from openstack_dashboard.dashboards.project.containers.tables import \ + ContainersTable +from openstack_dashboard.dashboards.project.containers.tables import \ + ObjectsTable +from openstack_dashboard.dashboards.project.containers.tables import \ + wrap_delimiter from openstack_dashboard.test import helpers as test -from .tables import ContainersTable, ObjectsTable, wrap_delimiter -from . import forms CONTAINER_INDEX_URL = reverse('horizon:project:containers:index') diff --git a/openstack_dashboard/dashboards/project/containers/urls.py b/openstack_dashboard/dashboards/project/containers/urls.py index 9965a9dd0c..46c71cc73b 100644 --- a/openstack_dashboard/dashboards/project/containers/urls.py +++ b/openstack_dashboard/dashboards/project/containers/urls.py @@ -18,9 +18,14 @@ # License for the specific language governing permissions and limitations # under the License. -from django.conf.urls.defaults import patterns, url +from django.conf.urls.defaults import patterns +from django.conf.urls.defaults import url -from .views import CreateView, UploadView, CopyView, ContainerView +from openstack_dashboard.dashboards.project.containers.views import \ + ContainerView +from openstack_dashboard.dashboards.project.containers.views import CopyView +from openstack_dashboard.dashboards.project.containers.views import CreateView +from openstack_dashboard.dashboards.project.containers.views import UploadView VIEW_MOD = 'openstack_dashboard.dashboards.project.containers.views' diff --git a/openstack_dashboard/dashboards/project/containers/views.py b/openstack_dashboard/dashboards/project/containers/views.py index c93b7de68e..7a614b9f21 100644 --- a/openstack_dashboard/dashboards/project/containers/views.py +++ b/openstack_dashboard/dashboards/project/containers/views.py @@ -21,10 +21,9 @@ """ Views for managing Swift containers. """ -import os -from django import http from django.core.urlresolvers import reverse +from django import http from django.utils.translation import ugettext_lazy as _ from horizon import browsers @@ -33,9 +32,17 @@ from horizon import forms from openstack_dashboard import api from openstack_dashboard.api.swift import FOLDER_DELIMITER -from .browsers import ContainerBrowser -from .forms import CreateContainer, UploadObject, CopyObject -from .tables import wrap_delimiter +from openstack_dashboard.dashboards.project.containers.browsers \ + import ContainerBrowser +from openstack_dashboard.dashboards.project.containers.forms import CopyObject +from openstack_dashboard.dashboards.project.containers.forms \ + import CreateContainer +from openstack_dashboard.dashboards.project.containers.forms \ + import UploadObject +from openstack_dashboard.dashboards.project.containers.tables \ + import wrap_delimiter + +import os class ContainerView(browsers.ResourceBrowserView): diff --git a/openstack_dashboard/dashboards/project/images_and_snapshots/images/tables.py b/openstack_dashboard/dashboards/project/images_and_snapshots/images/tables.py index badd796269..d2871f561b 100644 --- a/openstack_dashboard/dashboards/project/images_and_snapshots/images/tables.py +++ b/openstack_dashboard/dashboards/project/images_and_snapshots/images/tables.py @@ -14,8 +14,8 @@ # License for the specific language governing permissions and limitations # under the License. -import logging from collections import defaultdict +import logging from django.conf import settings from django.core.urlresolvers import reverse diff --git a/openstack_dashboard/dashboards/project/images_and_snapshots/images/tests.py b/openstack_dashboard/dashboards/project/images_and_snapshots/images/tests.py index 7f7a0a8276..27ff369124 100644 --- a/openstack_dashboard/dashboards/project/images_and_snapshots/images/tests.py +++ b/openstack_dashboard/dashboards/project/images_and_snapshots/images/tests.py @@ -20,11 +20,11 @@ import tempfile -from django import http from django.conf import settings from django.core.files.uploadedfile import InMemoryUploadedFile from django.core.urlresolvers import reverse from django.forms.widgets import HiddenInput +from django import http from django.test.utils import override_settings from mox import IsA diff --git a/openstack_dashboard/dashboards/project/images_and_snapshots/images/urls.py b/openstack_dashboard/dashboards/project/images_and_snapshots/images/urls.py index 6e990c9258..40dfbe1fe4 100644 --- a/openstack_dashboard/dashboards/project/images_and_snapshots/images/urls.py +++ b/openstack_dashboard/dashboards/project/images_and_snapshots/images/urls.py @@ -18,9 +18,12 @@ # License for the specific language governing permissions and limitations # under the License. -from django.conf.urls.defaults import patterns, url +from django.conf.urls.defaults import patterns +from django.conf.urls.defaults import url -from .views import UpdateView, DetailView, CreateView +from .views import CreateView +from .views import DetailView +from .views import UpdateView VIEWS_MOD = ('openstack_dashboard.dashboards.project' diff --git a/openstack_dashboard/dashboards/project/images_and_snapshots/images/views.py b/openstack_dashboard/dashboards/project/images_and_snapshots/images/views.py index 788ef302a7..4274afdcd6 100644 --- a/openstack_dashboard/dashboards/project/images_and_snapshots/images/views.py +++ b/openstack_dashboard/dashboards/project/images_and_snapshots/images/views.py @@ -24,7 +24,8 @@ Views for managing images. import logging -from django.core.urlresolvers import reverse, reverse_lazy +from django.core.urlresolvers import reverse +from django.core.urlresolvers import reverse_lazy from django.utils.translation import ugettext_lazy as _ from horizon import exceptions @@ -32,8 +33,9 @@ from horizon import forms from horizon import tabs from openstack_dashboard import api -from .forms import UpdateImageForm + from .forms import CreateImageForm +from .forms import UpdateImageForm from .tabs import ImageDetailTabs diff --git a/openstack_dashboard/dashboards/project/images_and_snapshots/snapshots/tests.py b/openstack_dashboard/dashboards/project/images_and_snapshots/snapshots/tests.py index bfe01ce215..55982dd580 100644 --- a/openstack_dashboard/dashboards/project/images_and_snapshots/snapshots/tests.py +++ b/openstack_dashboard/dashboards/project/images_and_snapshots/snapshots/tests.py @@ -18,8 +18,8 @@ # License for the specific language governing permissions and limitations # under the License. -from django import http from django.core.urlresolvers import reverse +from django import http from mox import IsA diff --git a/openstack_dashboard/dashboards/project/images_and_snapshots/snapshots/urls.py b/openstack_dashboard/dashboards/project/images_and_snapshots/snapshots/urls.py index 6fa2ca9f2a..5e5f29bc3a 100644 --- a/openstack_dashboard/dashboards/project/images_and_snapshots/snapshots/urls.py +++ b/openstack_dashboard/dashboards/project/images_and_snapshots/snapshots/urls.py @@ -18,7 +18,8 @@ # License for the specific language governing permissions and limitations # under the License. -from django.conf.urls.defaults import patterns, url +from django.conf.urls.defaults import patterns +from django.conf.urls.defaults import url from .views import CreateView diff --git a/openstack_dashboard/dashboards/project/images_and_snapshots/snapshots/views.py b/openstack_dashboard/dashboards/project/images_and_snapshots/snapshots/views.py index 75edff070d..7c6911af55 100644 --- a/openstack_dashboard/dashboards/project/images_and_snapshots/snapshots/views.py +++ b/openstack_dashboard/dashboards/project/images_and_snapshots/snapshots/views.py @@ -24,13 +24,15 @@ Views for managing instance snapshots. import logging -from django.core.urlresolvers import reverse, reverse_lazy +from django.core.urlresolvers import reverse +from django.core.urlresolvers import reverse_lazy from django.utils.translation import ugettext_lazy as _ from horizon import exceptions from horizon import forms from openstack_dashboard import api + from .forms import CreateSnapshot diff --git a/openstack_dashboard/dashboards/project/images_and_snapshots/tests.py b/openstack_dashboard/dashboards/project/images_and_snapshots/tests.py index 6205b24d55..68fa8024bd 100644 --- a/openstack_dashboard/dashboards/project/images_and_snapshots/tests.py +++ b/openstack_dashboard/dashboards/project/images_and_snapshots/tests.py @@ -19,8 +19,8 @@ # License for the specific language governing permissions and limitations # under the License. -from django import http from django.core.urlresolvers import reverse +from django import http from mox import IsA diff --git a/openstack_dashboard/dashboards/project/images_and_snapshots/urls.py b/openstack_dashboard/dashboards/project/images_and_snapshots/urls.py index d763deacef..3d3b323c77 100644 --- a/openstack_dashboard/dashboards/project/images_and_snapshots/urls.py +++ b/openstack_dashboard/dashboards/project/images_and_snapshots/urls.py @@ -22,7 +22,8 @@ from django.conf.urls.defaults import * from .images import urls as image_urls from .snapshots import urls as snapshot_urls -from .views import IndexView, DetailView +from .views import DetailView +from .views import IndexView urlpatterns = patterns('', diff --git a/openstack_dashboard/dashboards/project/images_and_snapshots/views.py b/openstack_dashboard/dashboards/project/images_and_snapshots/views.py index 307faefa97..59de700e46 100644 --- a/openstack_dashboard/dashboards/project/images_and_snapshots/views.py +++ b/openstack_dashboard/dashboards/project/images_and_snapshots/views.py @@ -33,6 +33,7 @@ from horizon import tabs from openstack_dashboard import api from openstack_dashboard.api.base import is_service_enabled + from .images.tables import ImagesTable from .volume_snapshots.tables import VolumeSnapshotsTable from .volume_snapshots.tabs import SnapshotDetailTabs diff --git a/openstack_dashboard/dashboards/project/images_and_snapshots/volume_snapshots/tables.py b/openstack_dashboard/dashboards/project/images_and_snapshots/volume_snapshots/tables.py index 2311e5c700..fa51e3e439 100644 --- a/openstack_dashboard/dashboards/project/images_and_snapshots/volume_snapshots/tables.py +++ b/openstack_dashboard/dashboards/project/images_and_snapshots/volume_snapshots/tables.py @@ -17,14 +17,15 @@ import logging from django.core.urlresolvers import reverse -from django.utils import safestring from django.utils.http import urlencode +from django.utils import safestring from django.utils.translation import ugettext_lazy as _ from horizon import tables from openstack_dashboard import api from openstack_dashboard.api import cinder + from ...volumes import tables as volume_tables diff --git a/openstack_dashboard/dashboards/project/images_and_snapshots/volume_snapshots/tests.py b/openstack_dashboard/dashboards/project/images_and_snapshots/volume_snapshots/tests.py index b90178043c..74b7a18078 100644 --- a/openstack_dashboard/dashboards/project/images_and_snapshots/volume_snapshots/tests.py +++ b/openstack_dashboard/dashboards/project/images_and_snapshots/volume_snapshots/tests.py @@ -18,8 +18,8 @@ # License for the specific language governing permissions and limitations # under the License. -from django import http from django.core.urlresolvers import reverse +from django import http from mox import IsA from openstack_dashboard import api diff --git a/openstack_dashboard/dashboards/project/instances/tables.py b/openstack_dashboard/dashboards/project/instances/tables.py index ed6096015b..dbe8c6261c 100644 --- a/openstack_dashboard/dashboards/project/instances/tables.py +++ b/openstack_dashboard/dashboards/project/instances/tables.py @@ -14,14 +14,14 @@ # License for the specific language governing permissions and limitations # under the License. -import logging +from django.core import urlresolvers from django import shortcuts from django import template -from django.core import urlresolvers from django.template.defaultfilters import title from django.utils.http import urlencode -from django.utils.translation import string_concat, ugettext_lazy as _ +from django.utils.translation import string_concat +from django.utils.translation import ugettext_lazy as _ from horizon.conf import HORIZON_CONFIG from horizon import exceptions @@ -30,12 +30,18 @@ from horizon import tables from horizon.templatetags import sizeformat from horizon.utils.filters import replace_underscores +import logging + from openstack_dashboard import api from openstack_dashboard.dashboards.project.access_and_security \ .floating_ips.workflows import IPAssociationWorkflow -from .tabs import InstanceDetailTabs, LogTab, ConsoleTab +from openstack_dashboard.dashboards.project.instances.tabs import ConsoleTab +from openstack_dashboard.dashboards.project.instances.tabs import \ + InstanceDetailTabs +from openstack_dashboard.dashboards.project.instances.tabs import LogTab -from novaclient.v1_1.servers import REBOOT_SOFT, REBOOT_HARD +from novaclient.v1_1.servers import REBOOT_HARD +from novaclient.v1_1.servers import REBOOT_SOFT LOG = logging.getLogger(__name__) diff --git a/openstack_dashboard/dashboards/project/instances/tabs.py b/openstack_dashboard/dashboards/project/instances/tabs.py index a4253d2e1f..8f4172d94a 100644 --- a/openstack_dashboard/dashboards/project/instances/tabs.py +++ b/openstack_dashboard/dashboards/project/instances/tabs.py @@ -14,8 +14,8 @@ # License for the specific language governing permissions and limitations # under the License. -from django.utils.translation import ugettext_lazy as _ from django.conf import settings +from django.utils.translation import ugettext_lazy as _ from horizon import exceptions from horizon import tabs diff --git a/openstack_dashboard/dashboards/project/instances/tests.py b/openstack_dashboard/dashboards/project/instances/tests.py index b5bd103d25..58f23edb53 100644 --- a/openstack_dashboard/dashboards/project/instances/tests.py +++ b/openstack_dashboard/dashboards/project/instances/tests.py @@ -20,22 +20,26 @@ import uuid -from django import http from django.core.urlresolvers import reverse -from django.utils.http import urlencode +from django import http from django.utils.datastructures import SortedDict +from django.utils.http import urlencode -from mox import IsA, IgnoreArg +from mox import IgnoreArg +from mox import IsA + +from horizon.workflows.views import WorkflowView from openstack_dashboard import api from openstack_dashboard.api import cinder from openstack_dashboard.test import helpers as test + from .tables import LaunchLink from .tabs import InstanceDetailTabs from .workflows import LaunchInstance -from horizon.workflows.views import WorkflowView -from novaclient.v1_1.servers import REBOOT_HARD, REBOOT_SOFT +from novaclient.v1_1.servers import REBOOT_HARD +from novaclient.v1_1.servers import REBOOT_SOFT INDEX_URL = reverse('horizon:project:instances:index') diff --git a/openstack_dashboard/dashboards/project/instances/urls.py b/openstack_dashboard/dashboards/project/instances/urls.py index dfccde337f..e80981dd07 100644 --- a/openstack_dashboard/dashboards/project/instances/urls.py +++ b/openstack_dashboard/dashboards/project/instances/urls.py @@ -18,10 +18,15 @@ # License for the specific language governing permissions and limitations # under the License. -from django.conf.urls.defaults import patterns, url +from django.conf.urls.defaults import patterns +from django.conf.urls.defaults import url -from .views import IndexView, UpdateView, DetailView, LaunchInstanceView -from .views import ResizeView +from openstack_dashboard.dashboards.project.instances.views import DetailView +from openstack_dashboard.dashboards.project.instances.views import IndexView +from openstack_dashboard.dashboards.project.instances.views import \ + LaunchInstanceView +from openstack_dashboard.dashboards.project.instances.views import ResizeView +from openstack_dashboard.dashboards.project.instances.views import UpdateView INSTANCES = r'^(?P[^/]+)/%s$' diff --git a/openstack_dashboard/dashboards/project/instances/views.py b/openstack_dashboard/dashboards/project/instances/views.py index c8e5c80ee6..7aff67d187 100644 --- a/openstack_dashboard/dashboards/project/instances/views.py +++ b/openstack_dashboard/dashboards/project/instances/views.py @@ -23,21 +23,29 @@ Views for managing instances. """ import logging +from django.core.urlresolvers import reverse +from django.core.urlresolvers import reverse_lazy from django import http from django import shortcuts -from django.core.urlresolvers import reverse, reverse_lazy from django.utils.datastructures import SortedDict from django.utils.translation import ugettext_lazy as _ from horizon import exceptions -from horizon import tabs from horizon import tables +from horizon import tabs from horizon import workflows from openstack_dashboard import api -from .tabs import InstanceDetailTabs -from .tables import InstancesTable -from .workflows import LaunchInstance, UpdateInstance, ResizeInstance +from openstack_dashboard.dashboards.project.instances.tables import \ + InstancesTable +from openstack_dashboard.dashboards.project.instances.tabs import \ + InstanceDetailTabs +from openstack_dashboard.dashboards.project.instances.workflows import \ + LaunchInstance +from openstack_dashboard.dashboards.project.instances.workflows import \ + ResizeInstance +from openstack_dashboard.dashboards.project.instances.workflows import \ + UpdateInstance LOG = logging.getLogger(__name__) diff --git a/openstack_dashboard/dashboards/project/instances/workflows/create_instance.py b/openstack_dashboard/dashboards/project/instances/workflows/create_instance.py index d030f1ed7b..072ec418f4 100644 --- a/openstack_dashboard/dashboards/project/instances/workflows/create_instance.py +++ b/openstack_dashboard/dashboards/project/instances/workflows/create_instance.py @@ -27,11 +27,12 @@ from django.views.decorators.debug import sensitive_variables from horizon import exceptions from horizon import forms -from horizon import workflows from horizon.utils import validators +from horizon import workflows from openstack_dashboard import api from openstack_dashboard.api import cinder + from ...images_and_snapshots.utils import get_available_images diff --git a/openstack_dashboard/dashboards/project/instances/workflows/resize_instance.py b/openstack_dashboard/dashboards/project/instances/workflows/resize_instance.py index 192968eafb..a5742ab5b0 100644 --- a/openstack_dashboard/dashboards/project/instances/workflows/resize_instance.py +++ b/openstack_dashboard/dashboards/project/instances/workflows/resize_instance.py @@ -15,15 +15,15 @@ # under the License. -import logging import json +import logging from django.utils.translation import ugettext_lazy as _ from django.views.decorators.debug import sensitive_variables from horizon import exceptions -from horizon import workflows from horizon import forms +from horizon import workflows from openstack_dashboard import api diff --git a/openstack_dashboard/dashboards/project/instances/workflows/update_instance.py b/openstack_dashboard/dashboards/project/instances/workflows/update_instance.py index d5c21169ee..f904d8b6ef 100644 --- a/openstack_dashboard/dashboards/project/instances/workflows/update_instance.py +++ b/openstack_dashboard/dashboards/project/instances/workflows/update_instance.py @@ -22,8 +22,8 @@ from django.utils.translation import ugettext_lazy as _ from horizon import exceptions -from horizon import workflows from horizon import forms +from horizon import workflows from openstack_dashboard import api diff --git a/openstack_dashboard/dashboards/project/loadbalancers/panel.py b/openstack_dashboard/dashboards/project/loadbalancers/panel.py index e12676804c..7e69656624 100644 --- a/openstack_dashboard/dashboards/project/loadbalancers/panel.py +++ b/openstack_dashboard/dashboards/project/loadbalancers/panel.py @@ -1,5 +1,5 @@ -from django.utils.translation import ugettext_lazy as _ from django.conf import settings +from django.utils.translation import ugettext_lazy as _ import horizon diff --git a/openstack_dashboard/dashboards/project/loadbalancers/tables.py b/openstack_dashboard/dashboards/project/loadbalancers/tables.py index 80bfa666e1..c221ff61f8 100644 --- a/openstack_dashboard/dashboards/project/loadbalancers/tables.py +++ b/openstack_dashboard/dashboards/project/loadbalancers/tables.py @@ -14,14 +14,15 @@ # License for the specific language governing permissions and limitations # under the License. -import logging -from django.utils import http from django.core.urlresolvers import reverse +from django.utils import http from django.utils.translation import ugettext_lazy as _ from horizon import tables +import logging + LOG = logging.getLogger(__name__) diff --git a/openstack_dashboard/dashboards/project/loadbalancers/tabs.py b/openstack_dashboard/dashboards/project/loadbalancers/tabs.py index f73f0f87aa..d62272f66b 100644 --- a/openstack_dashboard/dashboards/project/loadbalancers/tabs.py +++ b/openstack_dashboard/dashboards/project/loadbalancers/tabs.py @@ -14,6 +14,7 @@ # License for the specific language governing permissions and limitations # under the License. + from django.utils.translation import ugettext_lazy as _ from horizon import exceptions @@ -21,7 +22,9 @@ from horizon import tabs from openstack_dashboard import api -from .tables import PoolsTable, MembersTable, MonitorsTable +from .tables import MembersTable +from .tables import MonitorsTable +from .tables import PoolsTable class PoolsTab(tabs.TableTab): diff --git a/openstack_dashboard/dashboards/project/loadbalancers/tests.py b/openstack_dashboard/dashboards/project/loadbalancers/tests.py index aa69a77ff1..28ecc4c297 100644 --- a/openstack_dashboard/dashboards/project/loadbalancers/tests.py +++ b/openstack_dashboard/dashboards/project/loadbalancers/tests.py @@ -1,15 +1,26 @@ # vim: tabstop=4 shiftwidth=4 softtabstop=4 from mox import IsA + +from django.core.urlresolvers import reverse +from django.core.urlresolvers import reverse_lazy from django import http -from django.core.urlresolvers import reverse, reverse_lazy + +from horizon.workflows.views import WorkflowView + +from mox import IsA from openstack_dashboard import api +from openstack_dashboard.api.lbaas import Member +from openstack_dashboard.api.lbaas import Pool +from openstack_dashboard.api.lbaas import PoolMonitor +from openstack_dashboard.api.lbaas import Vip from openstack_dashboard.test import helpers as test -from openstack_dashboard.api.lbaas import Pool, Vip, Member, PoolMonitor -from .workflows import AddPool, AddMember, AddMonitor, AddVip -from horizon.workflows.views import WorkflowView +from .workflows import AddMember +from .workflows import AddMonitor +from .workflows import AddPool +from .workflows import AddVip class LoadBalancerTests(test.TestCase): diff --git a/openstack_dashboard/dashboards/project/loadbalancers/urls.py b/openstack_dashboard/dashboards/project/loadbalancers/urls.py index 1730c99217..f1ef7e593a 100644 --- a/openstack_dashboard/dashboards/project/loadbalancers/urls.py +++ b/openstack_dashboard/dashboards/project/loadbalancers/urls.py @@ -14,14 +14,35 @@ # License for the specific language governing permissions and limitations # under the License. -from django.conf.urls.defaults import url, patterns +from django.conf.urls.defaults import patterns +from django.conf.urls.defaults import url -from .views import IndexView -from .views import AddPoolView, AddMemberView, AddMonitorView, AddVipView -from .views import (UpdatePoolView, UpdateMemberView, - UpdateVipView, UpdateMonitorView) -from .views import PoolDetailsView, VipDetailsView -from .views import MemberDetailsView, MonitorDetailsView +from openstack_dashboard.dashboards.project.loadbalancers.views import \ + AddMemberView +from openstack_dashboard.dashboards.project.loadbalancers.views import \ + AddMonitorView +from openstack_dashboard.dashboards.project.loadbalancers.views import \ + AddPoolView +from openstack_dashboard.dashboards.project.loadbalancers.views import \ + AddVipView +from openstack_dashboard.dashboards.project.loadbalancers.views import \ + IndexView +from openstack_dashboard.dashboards.project.loadbalancers.views import \ + MemberDetailsView +from openstack_dashboard.dashboards.project.loadbalancers.views import \ + MonitorDetailsView +from openstack_dashboard.dashboards.project.loadbalancers.views import \ + PoolDetailsView +from openstack_dashboard.dashboards.project.loadbalancers.views import \ + UpdateMemberView +from openstack_dashboard.dashboards.project.loadbalancers.views import \ + UpdateMonitorView +from openstack_dashboard.dashboards.project.loadbalancers.views import \ + UpdatePoolView +from openstack_dashboard.dashboards.project.loadbalancers.views import \ + UpdateVipView +from openstack_dashboard.dashboards.project.loadbalancers.views import \ + VipDetailsView urlpatterns = patterns( 'openstack_dashboard.dashboards.project.loadbalancers.views', diff --git a/openstack_dashboard/dashboards/project/loadbalancers/views.py b/openstack_dashboard/dashboards/project/loadbalancers/views.py index c12d8dd3e1..28a2ab5440 100644 --- a/openstack_dashboard/dashboards/project/loadbalancers/views.py +++ b/openstack_dashboard/dashboards/project/loadbalancers/views.py @@ -14,9 +14,6 @@ # License for the specific language governing permissions and limitations # under the License. -import logging -import re - from django.core.urlresolvers import reverse_lazy from django.utils.translation import ugettext_lazy as _ @@ -25,13 +22,37 @@ from horizon import forms from horizon import tabs from horizon import workflows +import logging + from openstack_dashboard import api +from openstack_dashboard.dashboards.project.loadbalancers.forms import \ + UpdateMember +from openstack_dashboard.dashboards.project.loadbalancers.forms import \ + UpdateMonitor +from openstack_dashboard.dashboards.project.loadbalancers.forms import \ + UpdatePool +from openstack_dashboard.dashboards.project.loadbalancers.forms import \ + UpdateVip +from openstack_dashboard.dashboards.project.loadbalancers.tabs import \ + LoadBalancerTabs +from openstack_dashboard.dashboards.project.loadbalancers.tabs import \ + MemberDetailsTabs +from openstack_dashboard.dashboards.project.loadbalancers.tabs import \ + MonitorDetailsTabs +from openstack_dashboard.dashboards.project.loadbalancers.tabs import \ + PoolDetailsTabs +from openstack_dashboard.dashboards.project.loadbalancers.tabs import \ + VipDetailsTabs +from openstack_dashboard.dashboards.project.loadbalancers.workflows import \ + AddMember +from openstack_dashboard.dashboards.project.loadbalancers.workflows import \ + AddMonitor +from openstack_dashboard.dashboards.project.loadbalancers.workflows import \ + AddPool +from openstack_dashboard.dashboards.project.loadbalancers.workflows import \ + AddVip -from .workflows import AddPool, AddMember, AddMonitor, AddVip -from .forms import UpdatePool, UpdateVip, UpdateMember, UpdateMonitor -from .tabs import LoadBalancerTabs, PoolDetailsTabs, VipDetailsTabs -from .tabs import MemberDetailsTabs, MonitorDetailsTabs - +import re LOG = logging.getLogger(__name__) diff --git a/openstack_dashboard/dashboards/project/network_topology/urls.py b/openstack_dashboard/dashboards/project/network_topology/urls.py index 95c5e9fb0f..e218360f67 100644 --- a/openstack_dashboard/dashboards/project/network_topology/urls.py +++ b/openstack_dashboard/dashboards/project/network_topology/urls.py @@ -19,9 +19,11 @@ # under the License. -from django.conf.urls.defaults import url, patterns +from django.conf.urls.defaults import patterns +from django.conf.urls.defaults import url -from .views import (NetworkTopology, JSONView) +from .views import JSONView +from .views import NetworkTopology urlpatterns = patterns( diff --git a/openstack_dashboard/dashboards/project/networks/ports/urls.py b/openstack_dashboard/dashboards/project/networks/ports/urls.py index 7dd711a3b7..bd06460377 100644 --- a/openstack_dashboard/dashboards/project/networks/ports/urls.py +++ b/openstack_dashboard/dashboards/project/networks/ports/urls.py @@ -14,7 +14,8 @@ # License for the specific language governing permissions and limitations # under the License. -from django.conf.urls.defaults import patterns, url +from django.conf.urls.defaults import patterns +from django.conf.urls.defaults import url from .views import DetailView diff --git a/openstack_dashboard/dashboards/project/networks/subnets/tables.py b/openstack_dashboard/dashboards/project/networks/subnets/tables.py index a0ba72ff84..756d060af6 100644 --- a/openstack_dashboard/dashboards/project/networks/subnets/tables.py +++ b/openstack_dashboard/dashboards/project/networks/subnets/tables.py @@ -16,7 +16,8 @@ import logging -from django.core.urlresolvers import reverse, reverse_lazy +from django.core.urlresolvers import reverse +from django.core.urlresolvers import reverse_lazy from django.utils.translation import ugettext_lazy as _ from horizon import exceptions diff --git a/openstack_dashboard/dashboards/project/networks/subnets/urls.py b/openstack_dashboard/dashboards/project/networks/subnets/urls.py index a83e783b6c..07a562e751 100644 --- a/openstack_dashboard/dashboards/project/networks/subnets/urls.py +++ b/openstack_dashboard/dashboards/project/networks/subnets/urls.py @@ -14,7 +14,8 @@ # License for the specific language governing permissions and limitations # under the License. -from django.conf.urls.defaults import patterns, url +from django.conf.urls.defaults import patterns +from django.conf.urls.defaults import url from .views import DetailView diff --git a/openstack_dashboard/dashboards/project/networks/subnets/views.py b/openstack_dashboard/dashboards/project/networks/subnets/views.py index b33fd41937..937eb105f7 100644 --- a/openstack_dashboard/dashboards/project/networks/subnets/views.py +++ b/openstack_dashboard/dashboards/project/networks/subnets/views.py @@ -27,8 +27,10 @@ from horizon import tabs from horizon import workflows from openstack_dashboard import api + from .tabs import SubnetDetailTabs -from .workflows import CreateSubnet, UpdateSubnet +from .workflows import CreateSubnet +from .workflows import UpdateSubnet LOG = logging.getLogger(__name__) diff --git a/openstack_dashboard/dashboards/project/networks/tables.py b/openstack_dashboard/dashboards/project/networks/tables.py index bd1345ae53..b151d85d2e 100644 --- a/openstack_dashboard/dashboards/project/networks/tables.py +++ b/openstack_dashboard/dashboards/project/networks/tables.py @@ -15,8 +15,8 @@ # under the License. import logging -from django import template from django.core.urlresolvers import reverse +from django import template from django.template import defaultfilters as filters from django.utils.translation import ugettext_lazy as _ diff --git a/openstack_dashboard/dashboards/project/networks/tests.py b/openstack_dashboard/dashboards/project/networks/tests.py index 404da18fce..ddd66bab79 100644 --- a/openstack_dashboard/dashboards/project/networks/tests.py +++ b/openstack_dashboard/dashboards/project/networks/tests.py @@ -14,16 +14,18 @@ # License for the specific language governing permissions and limitations # under the License. -from django import http from django.core.urlresolvers import reverse +from django import http from django.utils.html import escape +from horizon.workflows.views import WorkflowView + from mox import IsA from openstack_dashboard import api from openstack_dashboard.test import helpers as test + from .workflows import CreateNetwork -from horizon.workflows.views import WorkflowView INDEX_URL = reverse('horizon:project:networks:index') diff --git a/openstack_dashboard/dashboards/project/networks/urls.py b/openstack_dashboard/dashboards/project/networks/urls.py index 06f53b79e0..bd89be6ff5 100644 --- a/openstack_dashboard/dashboards/project/networks/urls.py +++ b/openstack_dashboard/dashboards/project/networks/urls.py @@ -14,14 +14,19 @@ # License for the specific language governing permissions and limitations # under the License. -from django.conf.urls.defaults import patterns, url, include +from django.conf.urls.defaults import include +from django.conf.urls.defaults import patterns +from django.conf.urls.defaults import url -from .views import IndexView, CreateView, DetailView, UpdateView +from .ports import urls as port_urls +from .ports.views import UpdateView as EditPortView +from .subnets import urls as subnet_urls from .subnets.views import CreateView as AddSubnetView from .subnets.views import UpdateView as EditSubnetView -from .subnets import urls as subnet_urls -from .ports.views import UpdateView as EditPortView -from .ports import urls as port_urls +from .views import CreateView +from .views import DetailView +from .views import IndexView +from .views import UpdateView NETWORKS = r'^(?P[^/]+)/%s$' diff --git a/openstack_dashboard/dashboards/project/networks/views.py b/openstack_dashboard/dashboards/project/networks/views.py index 415fc29df8..1f17bbc962 100644 --- a/openstack_dashboard/dashboards/project/networks/views.py +++ b/openstack_dashboard/dashboards/project/networks/views.py @@ -28,10 +28,11 @@ from horizon import tables from horizon import workflows from openstack_dashboard import api -from .tables import NetworksTable -from .subnets.tables import SubnetsTable -from .ports.tables import PortsTable + from .forms import UpdateNetwork +from .ports.tables import PortsTable +from .subnets.tables import SubnetsTable +from .tables import NetworksTable from .workflows import CreateNetwork diff --git a/openstack_dashboard/dashboards/project/networks/workflows.py b/openstack_dashboard/dashboards/project/networks/workflows.py index 7b84da6fb9..06ca6ebe12 100644 --- a/openstack_dashboard/dashboards/project/networks/workflows.py +++ b/openstack_dashboard/dashboards/project/networks/workflows.py @@ -24,8 +24,8 @@ from django.utils.translation import ugettext_lazy as _ from horizon import exceptions from horizon import forms from horizon import messages -from horizon import workflows from horizon.utils import fields +from horizon import workflows from openstack_dashboard import api diff --git a/openstack_dashboard/dashboards/project/overview/tests.py b/openstack_dashboard/dashboards/project/overview/tests.py index bd16c0ae5d..060c82143b 100644 --- a/openstack_dashboard/dashboards/project/overview/tests.py +++ b/openstack_dashboard/dashboards/project/overview/tests.py @@ -20,15 +20,16 @@ import datetime -from django import http from django.core.urlresolvers import reverse +from django import http from django.utils import timezone -from mox import IsA, Func +from mox import Func +from mox import IsA from openstack_dashboard import api -from openstack_dashboard import usage from openstack_dashboard.test import helpers as test +from openstack_dashboard import usage INDEX_URL = reverse('horizon:project:overview:index') diff --git a/openstack_dashboard/dashboards/project/overview/urls.py b/openstack_dashboard/dashboards/project/overview/urls.py index 2a27d3df44..fa0350be5d 100644 --- a/openstack_dashboard/dashboards/project/overview/urls.py +++ b/openstack_dashboard/dashboards/project/overview/urls.py @@ -19,9 +19,11 @@ # under the License. -from django.conf.urls.defaults import url, patterns +from django.conf.urls.defaults import patterns +from django.conf.urls.defaults import url -from .views import ProjectOverview, WarningView +from .views import ProjectOverview +from .views import WarningView urlpatterns = patterns('openstack_dashboard.dashboards.project.overview.views', diff --git a/openstack_dashboard/dashboards/project/routers/forms.py b/openstack_dashboard/dashboards/project/routers/forms.py index 7cf9719bfc..75f5f97010 100644 --- a/openstack_dashboard/dashboards/project/routers/forms.py +++ b/openstack_dashboard/dashboards/project/routers/forms.py @@ -11,8 +11,8 @@ import logging from django.core.urlresolvers import reverse from django.utils.translation import ugettext_lazy as _ -from horizon import forms from horizon import exceptions +from horizon import forms from horizon import messages from openstack_dashboard import api diff --git a/openstack_dashboard/dashboards/project/routers/ports/forms.py b/openstack_dashboard/dashboards/project/routers/ports/forms.py index 51a85a3f2b..71480802dd 100644 --- a/openstack_dashboard/dashboards/project/routers/ports/forms.py +++ b/openstack_dashboard/dashboards/project/routers/ports/forms.py @@ -19,9 +19,9 @@ import logging from django.core.urlresolvers import reverse from django.utils.translation import ugettext_lazy as _ +from horizon import exceptions from horizon import forms from horizon import messages -from horizon import exceptions from horizon.utils import fields from openstack_dashboard import api diff --git a/openstack_dashboard/dashboards/project/routers/ports/urls.py b/openstack_dashboard/dashboards/project/routers/ports/urls.py index fa192c7dea..b5b611074d 100644 --- a/openstack_dashboard/dashboards/project/routers/ports/urls.py +++ b/openstack_dashboard/dashboards/project/routers/ports/urls.py @@ -14,7 +14,8 @@ # License for the specific language governing permissions and limitations # under the License. -from django.conf.urls.defaults import patterns, url +from django.conf.urls.defaults import patterns +from django.conf.urls.defaults import url from .views import DetailView diff --git a/openstack_dashboard/dashboards/project/routers/ports/views.py b/openstack_dashboard/dashboards/project/routers/ports/views.py index 2b0c5bd8d6..43933a44b8 100644 --- a/openstack_dashboard/dashboards/project/routers/ports/views.py +++ b/openstack_dashboard/dashboards/project/routers/ports/views.py @@ -18,12 +18,15 @@ import logging from django.core.urlresolvers import reverse -from horizon import tabs -from horizon import forms from horizon import exceptions +from horizon import forms +from horizon import tabs + from openstack_dashboard import api + +from .forms import AddInterface +from .forms import SetGatewayForm from .tabs import PortDetailTabs -from .forms import (AddInterface, SetGatewayForm) LOG = logging.getLogger(__name__) diff --git a/openstack_dashboard/dashboards/project/routers/tests.py b/openstack_dashboard/dashboards/project/routers/tests.py index b8d07eefbc..a83e98b915 100644 --- a/openstack_dashboard/dashboards/project/routers/tests.py +++ b/openstack_dashboard/dashboards/project/routers/tests.py @@ -13,9 +13,9 @@ # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. -from mox import IsA -from django import http from django.core.urlresolvers import reverse +from django import http +from mox import IsA from openstack_dashboard import api from openstack_dashboard.test import helpers as test diff --git a/openstack_dashboard/dashboards/project/routers/urls.py b/openstack_dashboard/dashboards/project/routers/urls.py index ea1c156c1e..4345ca5489 100644 --- a/openstack_dashboard/dashboards/project/routers/urls.py +++ b/openstack_dashboard/dashboards/project/routers/urls.py @@ -14,10 +14,14 @@ # License for the specific language governing permissions and limitations # under the License. -from django.conf.urls.defaults import patterns, url +from django.conf.urls.defaults import patterns +from django.conf.urls.defaults import url -from .views import (IndexView, CreateView, DetailView) -from .ports.views import (AddInterfaceView, SetGatewayView) +from .ports.views import AddInterfaceView +from .ports.views import SetGatewayView +from .views import CreateView +from .views import DetailView +from .views import IndexView urlpatterns = patterns('horizon.dashboards.project.routers.views', diff --git a/openstack_dashboard/dashboards/project/routers/views.py b/openstack_dashboard/dashboards/project/routers/views.py index e08df198b7..c7d8e8f227 100644 --- a/openstack_dashboard/dashboards/project/routers/views.py +++ b/openstack_dashboard/dashboards/project/routers/views.py @@ -21,15 +21,16 @@ Views for managing Quantum Routers. import logging from django.core.urlresolvers import reverse_lazy -from django.utils.translation import ugettext_lazy as _ from django.utils.datastructures import SortedDict +from django.utils.translation import ugettext_lazy as _ from horizon import exceptions from horizon import forms from horizon import tables from openstack_dashboard import api -from .ports.tables import PortsTable + from .forms import CreateForm +from .ports.tables import PortsTable from .tables import RoutersTable diff --git a/openstack_dashboard/dashboards/project/volumes/forms.py b/openstack_dashboard/dashboards/project/volumes/forms.py index 0f081effe0..26cadc0d02 100644 --- a/openstack_dashboard/dashboards/project/volumes/forms.py +++ b/openstack_dashboard/dashboards/project/volumes/forms.py @@ -13,18 +13,18 @@ from django.forms import ValidationError from django.template.defaultfilters import filesizeformat from django.utils.translation import ugettext_lazy as _ -from horizon import forms from horizon import exceptions +from horizon import forms from horizon import messages from horizon.utils.fields import SelectWidget from horizon.utils.functions import bytes_to_gigabytes from horizon.utils.memoized import memoized +from ..images_and_snapshots.utils import get_available_images +from ..instances.tables import ACTIVE_STATES from openstack_dashboard import api from openstack_dashboard.api import cinder from openstack_dashboard.api import glance -from ..images_and_snapshots.utils import get_available_images -from ..instances.tables import ACTIVE_STATES class CreateForm(forms.SelfHandlingForm): diff --git a/openstack_dashboard/dashboards/project/volumes/tables.py b/openstack_dashboard/dashboards/project/volumes/tables.py index b14145b8d6..0412a0be97 100644 --- a/openstack_dashboard/dashboards/project/volumes/tables.py +++ b/openstack_dashboard/dashboards/project/volumes/tables.py @@ -16,10 +16,11 @@ import logging -from django.core.urlresolvers import reverse, NoReverseMatch +from django.core.urlresolvers import NoReverseMatch +from django.core.urlresolvers import reverse from django.template.defaultfilters import title -from django.utils import safestring from django.utils.html import strip_tags +from django.utils import safestring from django.utils.translation import ugettext_lazy as _ from horizon import exceptions diff --git a/openstack_dashboard/dashboards/project/volumes/tabs.py b/openstack_dashboard/dashboards/project/volumes/tabs.py index 977190eca1..b266342bce 100644 --- a/openstack_dashboard/dashboards/project/volumes/tabs.py +++ b/openstack_dashboard/dashboards/project/volumes/tabs.py @@ -20,7 +20,8 @@ from django.utils.translation import ugettext_lazy as _ from horizon import exceptions from horizon import tabs -from openstack_dashboard.api import cinder, nova +from openstack_dashboard.api import cinder +from openstack_dashboard.api import nova class OverviewTab(tabs.Tab): diff --git a/openstack_dashboard/dashboards/project/volumes/tests.py b/openstack_dashboard/dashboards/project/volumes/tests.py index 1cac91d01d..2a24d8efe8 100644 --- a/openstack_dashboard/dashboards/project/volumes/tests.py +++ b/openstack_dashboard/dashboards/project/volumes/tests.py @@ -18,10 +18,10 @@ # License for the specific language governing permissions and limitations # under the License. -from django import http from django.conf import settings from django.core.urlresolvers import reverse from django.forms import widgets +from django import http from mox import IsA diff --git a/openstack_dashboard/dashboards/project/volumes/urls.py b/openstack_dashboard/dashboards/project/volumes/urls.py index 06b3572551..7518d45d8b 100644 --- a/openstack_dashboard/dashboards/project/volumes/urls.py +++ b/openstack_dashboard/dashboards/project/volumes/urls.py @@ -14,10 +14,14 @@ # License for the specific language governing permissions and limitations # under the License. -from django.conf.urls.defaults import patterns, url +from django.conf.urls.defaults import patterns +from django.conf.urls.defaults import url -from .views import (IndexView, CreateView, EditAttachmentsView, DetailView, - CreateSnapshotView) +from .views import CreateSnapshotView +from .views import CreateView +from .views import DetailView +from .views import EditAttachmentsView +from .views import IndexView urlpatterns = patterns('openstack_dashboard.dashboards.project.volumes.views', diff --git a/openstack_dashboard/dashboards/project/volumes/views.py b/openstack_dashboard/dashboards/project/volumes/views.py index edd0fe275a..28168889ec 100644 --- a/openstack_dashboard/dashboards/project/volumes/views.py +++ b/openstack_dashboard/dashboards/project/volumes/views.py @@ -18,22 +18,27 @@ Views for managing volumes. """ -import logging - from django.core.urlresolvers import reverse_lazy -from django.utils.translation import ugettext_lazy as _ from django.utils.datastructures import SortedDict +from django.utils.translation import ugettext_lazy as _ + +from .forms import AttachForm +from .forms import CreateForm +from .forms import CreateSnapshotForm from horizon import exceptions from horizon import forms from horizon import tables from horizon import tabs +import logging + from openstack_dashboard import api from openstack_dashboard.api import cinder from openstack_dashboard.usage import quotas -from .forms import CreateForm, AttachForm, CreateSnapshotForm -from .tables import AttachmentsTable, VolumesTable + +from .tables import AttachmentsTable +from .tables import VolumesTable from .tabs import VolumeDetailTabs diff --git a/openstack_dashboard/dashboards/settings/password/forms.py b/openstack_dashboard/dashboards/settings/password/forms.py index bc5498af3f..c87510ea32 100644 --- a/openstack_dashboard/dashboards/settings/password/forms.py +++ b/openstack_dashboard/dashboards/settings/password/forms.py @@ -16,12 +16,14 @@ from django.utils.translation import ugettext_lazy as _ from django.forms import ValidationError +from django.utils.translation import ugettext_lazy as _ from django.views.decorators.debug import sensitive_variables +from horizon import exceptions from horizon import forms from horizon import messages -from horizon import exceptions from horizon.utils import validators + from openstack_dashboard import api diff --git a/openstack_dashboard/dashboards/settings/password/tests.py b/openstack_dashboard/dashboards/settings/password/tests.py index c077a2e9ef..409b1ef875 100644 --- a/openstack_dashboard/dashboards/settings/password/tests.py +++ b/openstack_dashboard/dashboards/settings/password/tests.py @@ -14,8 +14,8 @@ # License for the specific language governing permissions and limitations # under the License. -from django import http from django.core.urlresolvers import reverse +from django import http from mox import IsA diff --git a/openstack_dashboard/dashboards/settings/password/urls.py b/openstack_dashboard/dashboards/settings/password/urls.py index 8d5804397f..637960ed16 100644 --- a/openstack_dashboard/dashboards/settings/password/urls.py +++ b/openstack_dashboard/dashboards/settings/password/urls.py @@ -14,7 +14,8 @@ # License for the specific language governing permissions and limitations # under the License. -from django.conf.urls.defaults import patterns, url +from django.conf.urls.defaults import patterns +from django.conf.urls.defaults import url from .views import PasswordView diff --git a/openstack_dashboard/dashboards/settings/user/forms.py b/openstack_dashboard/dashboards/settings/user/forms.py index 776346e171..67cdb7d08e 100644 --- a/openstack_dashboard/dashboards/settings/user/forms.py +++ b/openstack_dashboard/dashboards/settings/user/forms.py @@ -17,8 +17,8 @@ from datetime import datetime import pytz -from django import shortcuts from django.conf import settings +from django import shortcuts from django.utils import translation from django.utils.translation import ugettext_lazy as _ diff --git a/openstack_dashboard/dashboards/settings/user/urls.py b/openstack_dashboard/dashboards/settings/user/urls.py index ba5de426ff..6fdfdd9cc9 100644 --- a/openstack_dashboard/dashboards/settings/user/urls.py +++ b/openstack_dashboard/dashboards/settings/user/urls.py @@ -14,7 +14,8 @@ # License for the specific language governing permissions and limitations # under the License. -from django.conf.urls.defaults import patterns, url +from django.conf.urls.defaults import patterns +from django.conf.urls.defaults import url from .views import UserSettingsView diff --git a/openstack_dashboard/test/api_tests/base_tests.py b/openstack_dashboard/test/api_tests/base_tests.py index 9a0c140f5f..13493f9c8d 100644 --- a/openstack_dashboard/test/api_tests/base_tests.py +++ b/openstack_dashboard/test/api_tests/base_tests.py @@ -22,8 +22,8 @@ from __future__ import absolute_import from horizon import exceptions -from openstack_dashboard.test import helpers as test from openstack_dashboard.api import base as api_base +from openstack_dashboard.test import helpers as test class APIResource(api_base.APIResourceWrapper): diff --git a/openstack_dashboard/test/api_tests/lbaas_tests.py b/openstack_dashboard/test/api_tests/lbaas_tests.py index 2b006bd83a..cda6147daf 100644 --- a/openstack_dashboard/test/api_tests/lbaas_tests.py +++ b/openstack_dashboard/test/api_tests/lbaas_tests.py @@ -14,6 +14,7 @@ # License for the specific language governing permissions and limitations # under the License. + from openstack_dashboard import api from openstack_dashboard.test import helpers as test diff --git a/openstack_dashboard/test/api_tests/nova_tests.py b/openstack_dashboard/test/api_tests/nova_tests.py index 71e354f8e3..6d7da8f778 100644 --- a/openstack_dashboard/test/api_tests/nova_tests.py +++ b/openstack_dashboard/test/api_tests/nova_tests.py @@ -21,8 +21,8 @@ from __future__ import absolute_import -from django import http from django.conf import settings +from django import http from django.test.utils import override_settings from mox import IsA diff --git a/openstack_dashboard/test/api_tests/swift_tests.py b/openstack_dashboard/test/api_tests/swift_tests.py index d0ef9382e5..0e2c6e59d4 100644 --- a/openstack_dashboard/test/api_tests/swift_tests.py +++ b/openstack_dashboard/test/api_tests/swift_tests.py @@ -22,8 +22,9 @@ from __future__ import absolute_import from mox import IsA -from openstack_dashboard import api from horizon import exceptions + +from openstack_dashboard import api from openstack_dashboard.test import helpers as test diff --git a/openstack_dashboard/test/helpers.py b/openstack_dashboard/test/helpers.py index e19d75a024..990788bcad 100644 --- a/openstack_dashboard/test/helpers.py +++ b/openstack_dashboard/test/helpers.py @@ -21,29 +21,30 @@ from functools import wraps import os -from django import http from django.conf import settings -from django.contrib.messages.storage import default_storage from django.contrib.auth.middleware import AuthenticationMiddleware +from django.contrib.messages.storage import default_storage from django.core.handlers import wsgi +from django import http from django.test.client import RequestFactory from django.utils import unittest +from cinderclient import client as cinder_client import glanceclient +from heatclient import client as heat_client from keystoneclient.v2_0 import client as keystone_client from novaclient.v1_1 import client as nova_client from quantumclient.v2_0 import client as quantum_client from swiftclient import client as swift_client -from cinderclient import client as cinder_client -from heatclient import client as heat_client import httplib2 import mox -from openstack_auth import utils, user +from openstack_auth import user +from openstack_auth import utils -from horizon.test import helpers as horizon_helpers from horizon import middleware +from horizon.test import helpers as horizon_helpers from openstack_dashboard import api from openstack_dashboard import context_processors diff --git a/openstack_dashboard/test/settings.py b/openstack_dashboard/test/settings.py index f2310f6fb7..49b4446cbe 100644 --- a/openstack_dashboard/test/settings.py +++ b/openstack_dashboard/test/settings.py @@ -5,7 +5,9 @@ from django.utils.translation import ugettext_lazy as _ from horizon.test.settings import * from horizon.utils.secret_key import generate_or_read_from_file -from openstack_dashboard.exceptions import UNAUTHORIZED, RECOVERABLE, NOT_FOUND +from openstack_dashboard.exceptions import NOT_FOUND +from openstack_dashboard.exceptions import RECOVERABLE +from openstack_dashboard.exceptions import UNAUTHORIZED TEST_DIR = os.path.dirname(os.path.abspath(__file__)) diff --git a/openstack_dashboard/test/test_data/cinder_data.py b/openstack_dashboard/test/test_data/cinder_data.py index 7ae08cb792..84e0cb5468 100644 --- a/openstack_dashboard/test/test_data/cinder_data.py +++ b/openstack_dashboard/test/test_data/cinder_data.py @@ -13,8 +13,10 @@ # under the License. from cinderclient.v1 import quotas -from openstack_dashboard.api.base import Quota, QuotaSet as QuotaSetWrapper +from openstack_dashboard.api.base import Quota +from openstack_dashboard.api.base import QuotaSet as QuotaSetWrapper from openstack_dashboard.usage.quotas import QuotaUsage + from .utils import TestDataContainer diff --git a/openstack_dashboard/test/test_data/exceptions.py b/openstack_dashboard/test/test_data/exceptions.py index 413bacf95e..bfacce1b70 100644 --- a/openstack_dashboard/test/test_data/exceptions.py +++ b/openstack_dashboard/test/test_data/exceptions.py @@ -12,12 +12,12 @@ # License for the specific language governing permissions and limitations # under the License. +from cinderclient import exceptions as cinder_exceptions import glanceclient.exc as glance_exceptions from keystoneclient import exceptions as keystone_exceptions from novaclient import exceptions as nova_exceptions from quantumclient.common import exceptions as quantum_exceptions from swiftclient import client as swift_exceptions -from cinderclient import exceptions as cinder_exceptions from .utils import TestDataContainer diff --git a/openstack_dashboard/test/test_data/glance_data.py b/openstack_dashboard/test/test_data/glance_data.py index 9ad972b0e7..add8fb077c 100644 --- a/openstack_dashboard/test/test_data/glance_data.py +++ b/openstack_dashboard/test/test_data/glance_data.py @@ -12,7 +12,8 @@ # License for the specific language governing permissions and limitations # under the License. -from glanceclient.v1.images import Image, ImageManager +from glanceclient.v1.images import Image +from glanceclient.v1.images import ImageManager from .utils import TestDataContainer diff --git a/openstack_dashboard/test/test_data/heat_data.py b/openstack_dashboard/test/test_data/heat_data.py index f61aa12194..e72bcc5122 100644 --- a/openstack_dashboard/test/test_data/heat_data.py +++ b/openstack_dashboard/test/test_data/heat_data.py @@ -12,7 +12,8 @@ # License for the specific language governing permissions and limitations # under the License. -from heatclient.v1.stacks import Stack, StackManager +from heatclient.v1.stacks import Stack +from heatclient.v1.stacks import StackManager from .utils import TestDataContainer diff --git a/openstack_dashboard/test/test_data/keystone_data.py b/openstack_dashboard/test/test_data/keystone_data.py index d5e114bbfe..38f3f67a85 100644 --- a/openstack_dashboard/test/test_data/keystone_data.py +++ b/openstack_dashboard/test/test_data/keystone_data.py @@ -17,8 +17,13 @@ from datetime import timedelta from django.conf import settings from django.utils import datetime_safe -from keystoneclient.v2_0 import users, tenants, tokens, roles, ec2 -from keystoneclient.v3 import domains, groups +from keystoneclient.v2_0 import ec2 +from keystoneclient.v2_0 import roles +from keystoneclient.v2_0 import tenants +from keystoneclient.v2_0 import tokens +from keystoneclient.v2_0 import users +from keystoneclient.v3 import domains +from keystoneclient.v3 import groups from .utils import TestDataContainer diff --git a/openstack_dashboard/test/test_data/nova_data.py b/openstack_dashboard/test/test_data/nova_data.py index c80e05d06a..04b51f45fa 100644 --- a/openstack_dashboard/test/test_data/nova_data.py +++ b/openstack_dashboard/test/test_data/nova_data.py @@ -15,17 +15,25 @@ import json import uuid -from novaclient.v1_1 import (flavors, keypairs, servers, volumes, - volume_types, quotas, - floating_ips, usage, certs, - volume_snapshots as vol_snaps, - security_group_rules as rules, - security_groups as sec_groups, - availability_zones) +from novaclient.v1_1 import availability_zones +from novaclient.v1_1 import certs +from novaclient.v1_1 import flavors +from novaclient.v1_1 import floating_ips +from novaclient.v1_1 import keypairs +from novaclient.v1_1 import quotas +from novaclient.v1_1 import security_group_rules as rules +from novaclient.v1_1 import security_groups as sec_groups +from novaclient.v1_1 import servers +from novaclient.v1_1 import usage +from novaclient.v1_1 import volume_snapshots as vol_snaps +from novaclient.v1_1 import volume_types +from novaclient.v1_1 import volumes -from openstack_dashboard.api.base import Quota, QuotaSet as QuotaSetWrapper +from openstack_dashboard.api.base import Quota +from openstack_dashboard.api.base import QuotaSet as QuotaSetWrapper from openstack_dashboard.api.nova import FloatingIp as NetFloatingIp from openstack_dashboard.usage.quotas import QuotaUsage + from .utils import TestDataContainer diff --git a/openstack_dashboard/test/test_data/quantum_data.py b/openstack_dashboard/test/test_data/quantum_data.py index 0a5f2746d9..9602890bb1 100644 --- a/openstack_dashboard/test/test_data/quantum_data.py +++ b/openstack_dashboard/test/test_data/quantum_data.py @@ -14,10 +14,17 @@ import copy -from openstack_dashboard.api.quantum import (Network, Subnet, Port, - Router, FloatingIp) -from openstack_dashboard.api.lbaas import (Pool, Vip, Member, - PoolMonitor) +from openstack_dashboard.api.lbaas import Member +from openstack_dashboard.api.lbaas import Pool +from openstack_dashboard.api.lbaas import PoolMonitor +from openstack_dashboard.api.lbaas import Vip + +from openstack_dashboard.api.quantum import FloatingIp +from openstack_dashboard.api.quantum import Network +from openstack_dashboard.api.quantum import Port +from openstack_dashboard.api.quantum import Router +from openstack_dashboard.api.quantum import Subnet + from .utils import TestDataContainer diff --git a/openstack_dashboard/test/test_data/swift_data.py b/openstack_dashboard/test/test_data/swift_data.py index 11fc2e034e..e8998e67e3 100644 --- a/openstack_dashboard/test/test_data/swift_data.py +++ b/openstack_dashboard/test/test_data/swift_data.py @@ -13,6 +13,7 @@ # under the License. from openstack_dashboard.api import swift + from .utils import TestDataContainer diff --git a/openstack_dashboard/test/test_data/utils.py b/openstack_dashboard/test/test_data/utils.py index ac73408fb7..f99567a799 100644 --- a/openstack_dashboard/test/test_data/utils.py +++ b/openstack_dashboard/test/test_data/utils.py @@ -14,14 +14,14 @@ def load_test_data(load_onto=None): + from . import cinder_data from . import exceptions from . import glance_data + from . import heat_data from . import keystone_data from . import nova_data - from . import cinder_data from . import quantum_data from . import swift_data - from . import heat_data # The order of these loaders matters, some depend on others. loaders = (exceptions.data, diff --git a/openstack_dashboard/urls.py b/openstack_dashboard/urls.py index 64ef60530a..c4faae798e 100644 --- a/openstack_dashboard/urls.py +++ b/openstack_dashboard/urls.py @@ -22,9 +22,11 @@ URL patterns for the OpenStack Dashboard. """ -from django.conf.urls.defaults import patterns, url, include -from django.conf.urls.static import static from django.conf import settings +from django.conf.urls.defaults import include +from django.conf.urls.defaults import patterns +from django.conf.urls.defaults import url +from django.conf.urls.static import static from django.contrib.staticfiles.urls import staticfiles_urlpatterns import horizon diff --git a/openstack_dashboard/usage/__init__.py b/openstack_dashboard/usage/__init__.py index e636eed72b..2f63c83a47 100644 --- a/openstack_dashboard/usage/__init__.py +++ b/openstack_dashboard/usage/__init__.py @@ -14,9 +14,14 @@ # License for the specific language governing permissions and limitations # under the License. -from .base import BaseUsage, TenantUsage, GlobalUsage, almost_now -from .views import UsageView -from .tables import BaseUsageTable, TenantUsageTable, GlobalUsageTable +from openstack_dashboard.usage.base import almost_now +from openstack_dashboard.usage.base import BaseUsage +from openstack_dashboard.usage.base import GlobalUsage +from openstack_dashboard.usage.base import TenantUsage +from openstack_dashboard.usage.tables import BaseUsageTable +from openstack_dashboard.usage.tables import GlobalUsageTable +from openstack_dashboard.usage.tables import TenantUsageTable +from openstack_dashboard.usage.views import UsageView assert BaseUsage assert TenantUsage diff --git a/openstack_dashboard/usage/base.py b/openstack_dashboard/usage/base.py index 71015d8f26..f89649e1be 100644 --- a/openstack_dashboard/usage/base.py +++ b/openstack_dashboard/usage/base.py @@ -4,8 +4,8 @@ from calendar import monthrange import datetime import logging -from django.utils.translation import ugettext_lazy as _ from django.utils import timezone +from django.utils.translation import ugettext_lazy as _ from horizon import exceptions from horizon import forms diff --git a/openstack_dashboard/usage/quotas.py b/openstack_dashboard/usage/quotas.py index 68ec9b3b5c..fcd511545d 100644 --- a/openstack_dashboard/usage/quotas.py +++ b/openstack_dashboard/usage/quotas.py @@ -4,8 +4,11 @@ import itertools from horizon import exceptions from horizon.utils.memoized import memoized -from openstack_dashboard.api import nova, cinder, network -from openstack_dashboard.api.base import is_service_enabled, QuotaSet +from openstack_dashboard.api.base import is_service_enabled +from openstack_dashboard.api.base import QuotaSet +from openstack_dashboard.api import cinder +from openstack_dashboard.api import network +from openstack_dashboard.api import nova NOVA_QUOTA_FIELDS = ("metadata_items", "cores", diff --git a/openstack_dashboard/usage/tables.py b/openstack_dashboard/usage/tables.py index 5df8342a68..c5da8c475b 100644 --- a/openstack_dashboard/usage/tables.py +++ b/openstack_dashboard/usage/tables.py @@ -1,6 +1,7 @@ from django.core import urlresolvers +from django.template.defaultfilters import floatformat +from django.template.defaultfilters import timesince from django.utils.translation import ugettext_lazy as _ -from django.template.defaultfilters import timesince, floatformat from horizon import tables from horizon.templatetags.sizeformat import mbformat diff --git a/openstack_dashboard/usage/views.py b/openstack_dashboard/usage/views.py index 38d02a9b24..e0b5063158 100644 --- a/openstack_dashboard/usage/views.py +++ b/openstack_dashboard/usage/views.py @@ -1,7 +1,7 @@ import logging from horizon import tables -from .base import BaseUsage +from openstack_dashboard.usage.base import BaseUsage LOG = logging.getLogger(__name__) diff --git a/tox.ini b/tox.ini index fcfbc00068..ca71f1decd 100644 --- a/tox.ini +++ b/tox.ini @@ -44,7 +44,6 @@ exclude = .venv,.git,.tox,dist,doc,*openstack/common*,*lib/python*,*egg,build,p # F999 syntax error in doctest # H101 Use TODO(NAME) # H201 no 'except:' at least use 'except Exception:' -# H301 one import per line # H302 import only modules.'from optparse import make_option' does not import a module # H303 No wildcard (*) import. # H304 No relative imports. 'from .views import IndexView' is a relative import @@ -52,4 +51,4 @@ exclude = .venv,.git,.tox,dist,doc,*openstack/common*,*lib/python*,*egg,build,p # H4xx docstrings # H701 empty localization string # H702 Formatting operation should be outside of localization method call -ignore = E121,E126,E127,E128,F403,F811,F821,F841,F999,H101,H201,H301,H302,H303,H304,H306,H4,H701,H702 +ignore = E121,E126,E127,E128,F403,F811,F821,F841,F999,H101,H201,H302,H303,H304,H306,H4,H701,H702