Merge "remove unused imports"
This commit is contained in:
commit
a30752d9a2
@ -47,3 +47,8 @@ if Horizon:
|
||||
get_default_dashboard = Horizon.get_default_dashboard
|
||||
get_dashboards = Horizon.get_dashboards
|
||||
urls = Horizon._lazy_urls
|
||||
|
||||
# silence flake8 about unused imports here:
|
||||
assert Dashboard
|
||||
assert Panel
|
||||
assert PanelGroup
|
||||
|
@ -16,3 +16,6 @@
|
||||
|
||||
from .base import ResourceBrowser
|
||||
from .views import ResourceBrowserView
|
||||
|
||||
assert ResourceBrowser
|
||||
assert ResourceBrowserView
|
||||
|
@ -22,3 +22,12 @@ from django.forms import widgets
|
||||
from .base import SelfHandlingMixin, SelfHandlingForm, DateForm
|
||||
from .views import ModalFormView, ModalFormMixin
|
||||
from .fields import DynamicTypedChoiceField, DynamicChoiceField
|
||||
|
||||
assert widgets
|
||||
assert SelfHandlingMixin
|
||||
assert SelfHandlingForm
|
||||
assert DateForm
|
||||
assert ModalFormView
|
||||
assert ModalFormMixin
|
||||
assert DynamicTypedChoiceField
|
||||
assert DynamicChoiceField
|
||||
|
@ -20,3 +20,17 @@ from .actions import (Action, BatchAction, DeleteAction,
|
||||
from .base import DataTable, Column, Row
|
||||
from .views import DataTableView, MultiTableView, MultiTableMixin, \
|
||||
MixedDataTableView
|
||||
|
||||
assert Action
|
||||
assert BatchAction
|
||||
assert DeleteAction
|
||||
assert LinkAction
|
||||
assert FilterAction
|
||||
assert FixedFilterAction
|
||||
assert DataTable
|
||||
assert Column
|
||||
assert Row
|
||||
assert DataTableView
|
||||
assert MultiTableView
|
||||
assert MultiTableMixin
|
||||
assert MixedDataTableView
|
||||
|
@ -16,3 +16,9 @@
|
||||
|
||||
from .base import TabGroup, Tab, TableTab
|
||||
from .views import TabView, TabbedTableView
|
||||
|
||||
assert TabGroup
|
||||
assert Tab
|
||||
assert TableTab
|
||||
assert TabView
|
||||
assert TabbedTableView
|
||||
|
@ -1,2 +1,8 @@
|
||||
from .base import Workflow, Step, Action, UpdateMembersStep
|
||||
from .views import WorkflowView
|
||||
|
||||
assert Action
|
||||
assert Step
|
||||
assert UpdateMembersStep
|
||||
assert Workflow
|
||||
assert WorkflowView
|
||||
|
@ -43,3 +43,14 @@ 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
|
||||
assert cinder
|
||||
assert heat
|
||||
assert glance
|
||||
assert keystone
|
||||
assert network
|
||||
assert nova
|
||||
assert quantum
|
||||
assert lbaas
|
||||
assert swift
|
||||
|
@ -30,7 +30,7 @@ from django.utils.translation import ugettext_lazy as _
|
||||
from novaclient.v1_1 import client as nova_client
|
||||
from novaclient.v1_1 import security_group_rules as nova_rules
|
||||
from novaclient.v1_1.security_groups import SecurityGroup as NovaSecurityGroup
|
||||
from novaclient.v1_1.servers import REBOOT_HARD, REBOOT_SOFT
|
||||
from novaclient.v1_1.servers import REBOOT_HARD
|
||||
|
||||
from horizon.conf import HORIZON_CONFIG
|
||||
from horizon.utils.memoized import memoized
|
||||
|
@ -27,8 +27,6 @@ from django.conf import settings
|
||||
from quantumclient.v2_0 import client as quantum_client
|
||||
from django.utils.datastructures import SortedDict
|
||||
|
||||
from horizon.conf import HORIZON_CONFIG
|
||||
|
||||
from openstack_dashboard.api.base import APIDictWrapper, url_for
|
||||
from openstack_dashboard.api import network
|
||||
from openstack_dashboard.api import nova
|
||||
|
@ -21,7 +21,6 @@ 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 openstack_dashboard import api
|
||||
|
||||
|
@ -22,7 +22,6 @@ from horizon import tabs
|
||||
from openstack_dashboard.api import keystone
|
||||
from openstack_dashboard.usage import quotas
|
||||
from .tables import QuotasTable, ServicesTable
|
||||
from openstack_dashboard.api.base import is_service_enabled
|
||||
|
||||
|
||||
class DefaultQuotasTab(tabs.TableTab):
|
||||
|
@ -20,7 +20,9 @@
|
||||
|
||||
from django.conf.urls.defaults import url, patterns
|
||||
|
||||
from .views import DetailView, AdminIndexView, AdminUpdateView
|
||||
from .views import AdminIndexView, AdminUpdateView
|
||||
from openstack_dashboard.dashboards.project.instances.views import \
|
||||
DetailView
|
||||
|
||||
|
||||
INSTANCES = r'^(?P<instance_id>[^/]+)/%s$'
|
||||
|
@ -31,13 +31,28 @@ from openstack_dashboard import api
|
||||
from openstack_dashboard.dashboards.admin.instances.tables import \
|
||||
AdminInstancesTable
|
||||
from openstack_dashboard.dashboards.project.instances.views import \
|
||||
console, DetailView, vnc, spice, UpdateView
|
||||
console as p_console, vnc as p_vnc, spice as p_spice, UpdateView
|
||||
from openstack_dashboard.dashboards.project.instances.workflows.\
|
||||
update_instance import AdminUpdateInstance
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
||||
|
||||
# re-use console from project.instances.views to make reflection work
|
||||
def console(args, **kvargs):
|
||||
return p_console(args, **kvargs)
|
||||
|
||||
|
||||
# re-use vnc from project.instances.views to make reflection work
|
||||
def vnc(args, **kvargs):
|
||||
return p_vnc(args, **kvargs)
|
||||
|
||||
|
||||
# re-use spice from project.instances.views to make reflection work
|
||||
def spice(args, **kvargs):
|
||||
return p_spice(args, **kvargs)
|
||||
|
||||
|
||||
class AdminUpdateView(UpdateView):
|
||||
workflow_class = AdminUpdateInstance
|
||||
|
||||
|
@ -16,13 +16,6 @@
|
||||
|
||||
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 openstack_dashboard import api
|
||||
from openstack_dashboard.dashboards.project.networks.subnets \
|
||||
import views as project_views
|
||||
|
||||
|
@ -20,7 +20,7 @@ from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
from horizon import tables
|
||||
from openstack_dashboard.dashboards.project.networks.ports.tables import\
|
||||
get_fixed_ips, get_attached
|
||||
get_fixed_ips
|
||||
from openstack_dashboard.dashboards.project.routers.ports.tables import\
|
||||
get_device_owner
|
||||
|
||||
|
@ -35,6 +35,8 @@ from openstack_dashboard.dashboards.project.access_and_security \
|
||||
.floating_ips.workflows import IPAssociationWorkflow
|
||||
from .tabs import InstanceDetailTabs, LogTab, ConsoleTab
|
||||
|
||||
from novaclient.v1_1.servers import REBOOT_SOFT, REBOOT_HARD
|
||||
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
||||
@ -96,7 +98,7 @@ class RebootInstance(tables.BatchAction):
|
||||
and not is_deleting(instance))
|
||||
|
||||
def action(self, request, obj_id):
|
||||
api.nova.server_reboot(request, obj_id, api.nova.REBOOT_HARD)
|
||||
api.nova.server_reboot(request, obj_id, REBOOT_HARD)
|
||||
|
||||
|
||||
class SoftRebootInstance(RebootInstance):
|
||||
@ -105,7 +107,7 @@ class SoftRebootInstance(RebootInstance):
|
||||
action_past = _("Soft Rebooted")
|
||||
|
||||
def action(self, request, obj_id):
|
||||
api.nova.server_reboot(request, obj_id, api.nova.REBOOT_SOFT)
|
||||
api.nova.server_reboot(request, obj_id, REBOOT_SOFT)
|
||||
|
||||
|
||||
class TogglePause(tables.BatchAction):
|
||||
|
@ -35,6 +35,7 @@ from .tabs import InstanceDetailTabs
|
||||
from .workflows import LaunchInstance
|
||||
from horizon.workflows.views import WorkflowView
|
||||
|
||||
from novaclient.v1_1.servers import REBOOT_HARD, REBOOT_SOFT
|
||||
|
||||
INDEX_URL = reverse('horizon:project:instances:index')
|
||||
|
||||
@ -275,7 +276,7 @@ class InstanceTests(test.TestCase):
|
||||
api.nova.server_list(IsA(http.HttpRequest), search_opts=search_opts) \
|
||||
.AndReturn([self.servers.list(), False])
|
||||
api.nova.server_reboot(IsA(http.HttpRequest), server.id,
|
||||
api.nova.REBOOT_HARD)
|
||||
REBOOT_HARD)
|
||||
|
||||
self.mox.ReplayAll()
|
||||
|
||||
@ -296,7 +297,7 @@ class InstanceTests(test.TestCase):
|
||||
api.nova.server_list(IsA(http.HttpRequest), search_opts=search_opts) \
|
||||
.AndReturn([self.servers.list(), False])
|
||||
api.nova.server_reboot(IsA(http.HttpRequest), server.id,
|
||||
api.nova.REBOOT_HARD) \
|
||||
REBOOT_HARD) \
|
||||
.AndRaise(self.exceptions.nova)
|
||||
|
||||
self.mox.ReplayAll()
|
||||
@ -318,7 +319,7 @@ class InstanceTests(test.TestCase):
|
||||
api.nova.server_list(IsA(http.HttpRequest), search_opts=search_opts) \
|
||||
.AndReturn([self.servers.list(), False])
|
||||
api.nova.server_reboot(IsA(http.HttpRequest), server.id,
|
||||
api.nova.REBOOT_SOFT)
|
||||
REBOOT_SOFT)
|
||||
|
||||
self.mox.ReplayAll()
|
||||
|
||||
|
@ -30,7 +30,6 @@ 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 tabs
|
||||
from horizon import tables
|
||||
from horizon import workflows
|
||||
|
@ -19,7 +19,6 @@ import logging
|
||||
import json
|
||||
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
from django.utils.datastructures import SortedDict
|
||||
from django.views.decorators.debug import sensitive_variables
|
||||
|
||||
from horizon import exceptions
|
||||
|
@ -20,16 +20,12 @@
|
||||
|
||||
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
from django.core.urlresolvers import reverse
|
||||
|
||||
from horizon import exceptions
|
||||
from horizon import workflows
|
||||
from horizon import forms
|
||||
from horizon import messages
|
||||
|
||||
from openstack_dashboard import api
|
||||
from openstack_dashboard.api import cinder, nova
|
||||
from openstack_dashboard.api.base import is_service_enabled
|
||||
|
||||
|
||||
INDEX_URL = "horizon:projects:instances:index"
|
||||
|
@ -21,7 +21,6 @@ from django.core.urlresolvers import reverse
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
from horizon import tables
|
||||
from openstack_dashboard import api
|
||||
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
@ -14,13 +14,10 @@
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
import re
|
||||
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
from horizon import exceptions
|
||||
from horizon import tabs
|
||||
from horizon import tables
|
||||
|
||||
from openstack_dashboard import api
|
||||
|
||||
|
@ -1,7 +1,5 @@
|
||||
# vim: tabstop=4 shiftwidth=4 softtabstop=4
|
||||
|
||||
import json
|
||||
|
||||
from mox import IsA
|
||||
from django import http
|
||||
from django.core.urlresolvers import reverse, reverse_lazy
|
||||
@ -10,8 +8,6 @@ from openstack_dashboard import api
|
||||
from openstack_dashboard.test import helpers as test
|
||||
from openstack_dashboard.api.lbaas import Pool, Vip, Member, PoolMonitor
|
||||
|
||||
from .tabs import LoadBalancerTabs, MembersTab, PoolsTab, MonitorsTab
|
||||
from .forms import UpdatePool
|
||||
from .workflows import AddPool, AddMember, AddMonitor, AddVip
|
||||
from horizon.workflows.views import WorkflowView
|
||||
|
||||
|
@ -17,13 +17,11 @@
|
||||
import logging
|
||||
import re
|
||||
|
||||
from django import http
|
||||
from django.core.urlresolvers import reverse_lazy
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
from horizon import exceptions
|
||||
from horizon import forms
|
||||
from horizon import tables
|
||||
from horizon import tabs
|
||||
from horizon import workflows
|
||||
|
||||
@ -33,7 +31,6 @@ 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
|
||||
from .tables import DeleteMonitorLink
|
||||
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
@ -15,7 +15,6 @@
|
||||
# under the License.
|
||||
|
||||
import logging
|
||||
import re
|
||||
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
|
@ -19,7 +19,7 @@ Views for managing Quantum Subnets.
|
||||
"""
|
||||
import logging
|
||||
|
||||
from django.core.urlresolvers import reverse_lazy, reverse
|
||||
from django.core.urlresolvers import reverse
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
from horizon import exceptions
|
||||
|
@ -16,8 +16,6 @@
|
||||
|
||||
import logging
|
||||
|
||||
import netaddr
|
||||
|
||||
from django.core.urlresolvers import reverse
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
|
@ -19,7 +19,6 @@ from django.core.urlresolvers import reverse
|
||||
from django.utils.html import escape
|
||||
|
||||
from mox import IsA
|
||||
import netaddr
|
||||
|
||||
from openstack_dashboard import api
|
||||
from openstack_dashboard.test import helpers as test
|
||||
|
@ -20,7 +20,6 @@ Views for managing Quantum Routers.
|
||||
|
||||
import logging
|
||||
|
||||
from django import shortcuts
|
||||
from django.core.urlresolvers import reverse_lazy
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
from django.utils.datastructures import SortedDict
|
||||
@ -28,12 +27,10 @@ from django.utils.datastructures import SortedDict
|
||||
from horizon import exceptions
|
||||
from horizon import forms
|
||||
from horizon import tables
|
||||
from horizon import tabs
|
||||
from openstack_dashboard import api
|
||||
from .ports.tables import PortsTable
|
||||
from .forms import CreateForm
|
||||
from .tables import RoutersTable
|
||||
from .tabs import RouterDetailTabs
|
||||
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
@ -23,7 +23,6 @@ from horizon.utils.memoized import memoized
|
||||
from openstack_dashboard import api
|
||||
from openstack_dashboard.api import cinder
|
||||
from openstack_dashboard.api import glance
|
||||
from openstack_dashboard.usage import quotas
|
||||
from ..images_and_snapshots.utils import get_available_images
|
||||
from ..instances.tables import ACTIVE_STATES
|
||||
|
||||
|
@ -23,12 +23,11 @@ from django.conf import settings
|
||||
from django.core.urlresolvers import reverse
|
||||
from django.forms import widgets
|
||||
|
||||
from mox import IsA, IgnoreArg
|
||||
from mox import IsA
|
||||
|
||||
from openstack_dashboard import api
|
||||
from openstack_dashboard.api import cinder
|
||||
from openstack_dashboard.test import helpers as test
|
||||
from openstack_dashboard.usage import quotas
|
||||
|
||||
|
||||
class VolumeViewTests(test.TestCase):
|
||||
|
@ -15,7 +15,6 @@
|
||||
# under the License.
|
||||
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
from django.core.urlresolvers import reverse
|
||||
from django.forms import ValidationError
|
||||
from django.views.decorators.debug import sensitive_variables
|
||||
|
||||
|
@ -12,9 +12,6 @@
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from django.conf import settings
|
||||
from django.test.utils import override_settings
|
||||
|
||||
from openstack_dashboard import api
|
||||
from openstack_dashboard.test import helpers as test
|
||||
|
||||
|
@ -14,12 +14,8 @@
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from mox import IsA
|
||||
from django import http
|
||||
|
||||
from openstack_dashboard import api
|
||||
from openstack_dashboard.test import helpers as test
|
||||
from openstack_dashboard.api.lbaas import Vip, Pool, Member, PoolMonitor
|
||||
|
||||
from quantumclient.v2_0.client import Client as quantumclient
|
||||
|
||||
|
@ -12,7 +12,6 @@
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
import copy
|
||||
import json
|
||||
import uuid
|
||||
|
||||
|
@ -17,3 +17,12 @@
|
||||
from .base import BaseUsage, TenantUsage, GlobalUsage, almost_now
|
||||
from .views import UsageView
|
||||
from .tables import BaseUsageTable, TenantUsageTable, GlobalUsageTable
|
||||
|
||||
assert BaseUsage
|
||||
assert TenantUsage
|
||||
assert GlobalUsage
|
||||
assert almost_now
|
||||
assert UsageView
|
||||
assert BaseUsageTable
|
||||
assert TenantUsageTable
|
||||
assert GlobalUsageTable
|
||||
|
2
tox.ini
2
tox.ini
@ -52,4 +52,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,F401,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,H301,H302,H303,H304,H306,H4,H701,H702
|
||||
|
Loading…
Reference in New Issue
Block a user