summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTzu-Mainn Chen <tzumainn@redhat.com>2013-08-05 18:12:15 -0400
committerTzu-Mainn Chen <tzumainn@redhat.com>2013-08-05 23:35:10 -0400
commit6a88a8c1b23a6a3c5fbc6aec4feef9fd1930a5fc (patch)
tree69106914b113827f9e8da97459b8c414629ddc76
parentfe8ce143fda4e81dc61d4fa54b79343cd38bfb86 (diff)
downloadtuskar-ui-6a88a8c1b23a6a3c5fbc6aec4feef9fd1930a5fc.tar.gz
fixed pep8 failures
-rw-r--r--horizon/forms/__init__.py6
-rw-r--r--horizon/workflows/__init__.py6
-rw-r--r--openstack_dashboard/api/nova.py2
-rw-r--r--openstack_dashboard/api/tuskar.py15
-rw-r--r--openstack_dashboard/dashboards/infrastructure/models.py4
-rw-r--r--openstack_dashboard/dashboards/infrastructure/overview/urls.py3
-rw-r--r--openstack_dashboard/dashboards/infrastructure/resource_management/flavors/tables.py2
-rw-r--r--openstack_dashboard/dashboards/infrastructure/resource_management/flavors/urls.py15
-rw-r--r--openstack_dashboard/dashboards/infrastructure/resource_management/flavors/views.py8
-rw-r--r--openstack_dashboard/dashboards/infrastructure/resource_management/nodes/tests.py4
-rw-r--r--openstack_dashboard/dashboards/infrastructure/resource_management/nodes/urls.py6
-rw-r--r--openstack_dashboard/dashboards/infrastructure/resource_management/nodes/views.py7
-rw-r--r--openstack_dashboard/dashboards/infrastructure/resource_management/racks/tabs.py3
-rw-r--r--openstack_dashboard/dashboards/infrastructure/resource_management/racks/tests.py6
-rw-r--r--openstack_dashboard/dashboards/infrastructure/resource_management/racks/urls.py16
-rw-r--r--openstack_dashboard/dashboards/infrastructure/resource_management/racks/views.py19
-rw-r--r--openstack_dashboard/dashboards/infrastructure/resource_management/racks/workflows.py32
-rw-r--r--openstack_dashboard/dashboards/infrastructure/resource_management/resource_classes/tables.py14
-rw-r--r--openstack_dashboard/dashboards/infrastructure/resource_management/resource_classes/tabs.py6
-rw-r--r--openstack_dashboard/dashboards/infrastructure/resource_management/resource_classes/urls.py17
-rw-r--r--openstack_dashboard/dashboards/infrastructure/resource_management/resource_classes/views.py20
-rw-r--r--openstack_dashboard/dashboards/infrastructure/resource_management/resource_classes/workflows.py6
-rw-r--r--openstack_dashboard/dashboards/infrastructure/resource_management/tabs.py11
-rw-r--r--openstack_dashboard/dashboards/infrastructure/resource_management/urls.py15
-rw-r--r--openstack_dashboard/dashboards/infrastructure/resource_management/views.py3
-rw-r--r--openstack_dashboard/dashboards/infrastructure/service_management/panel.py2
-rw-r--r--openstack_dashboard/dashboards/infrastructure/service_management/urls.py6
-rw-r--r--openstack_dashboard/test/api_tests/tuskar_tests.py11
-rw-r--r--openstack_dashboard/test/test_data/tuskar_data.py12
29 files changed, 172 insertions, 105 deletions
diff --git a/horizon/forms/__init__.py b/horizon/forms/__init__.py
index 27b233f7..55135846 100644
--- a/horizon/forms/__init__.py
+++ b/horizon/forms/__init__.py
@@ -24,6 +24,8 @@ from horizon.forms.base import SelfHandlingForm
from horizon.forms.base import SelfHandlingMixin
from horizon.forms.fields import DynamicChoiceField
from horizon.forms.fields import DynamicTypedChoiceField
+# FIXME: TableStep hack adding NumberInput
+from horizon.forms.fields import NumberInput
from horizon.forms.views import ModalFormMixin
from horizon.forms.views import ModalFormView
@@ -35,6 +37,4 @@ assert ModalFormView
assert ModalFormMixin
assert DynamicTypedChoiceField
assert DynamicChoiceField
-
-# FIXME: TableStep hack adding NumberInput
-from horizon.forms.fields import NumberInput
+assert NumberInput
diff --git a/horizon/workflows/__init__.py b/horizon/workflows/__init__.py
index 145a3bd3..cb4a916f 100644
--- a/horizon/workflows/__init__.py
+++ b/horizon/workflows/__init__.py
@@ -1,15 +1,13 @@
from horizon.workflows.base import Action
from horizon.workflows.base import Step
+from horizon.workflows.base import TableStep
from horizon.workflows.base import UpdateMembersStep
from horizon.workflows.base import Workflow
from horizon.workflows.views import WorkflowView
assert Action
assert Step
+assert TableStep
assert UpdateMembersStep
assert Workflow
assert WorkflowView
-
-# FIXME: TableStep adding UpdateMembersStep
-from horizon.workflows.base import UpdateMembersStep
-from horizon.workflows.base import TableStep
diff --git a/openstack_dashboard/api/nova.py b/openstack_dashboard/api/nova.py
index 35535183..ba42c9b0 100644
--- a/openstack_dashboard/api/nova.py
+++ b/openstack_dashboard/api/nova.py
@@ -30,10 +30,8 @@ from django.utils.translation import ugettext_lazy as _
from novaclient.v1_1 import client as nova_client
from novaclient.v1_1.contrib.list_extensions import ListExtManager
from novaclient.v1_1 import security_group_rules as nova_rules
-from novaclient.v1_1.contrib import baremetal
from novaclient.v1_1.security_groups import SecurityGroup as NovaSecurityGroup
from novaclient.v1_1.servers import REBOOT_HARD
-from novaclient.v1_1.servers import REBOOT_SOFT
from horizon.conf import HORIZON_CONFIG
from horizon.utils.memoized import memoized
diff --git a/openstack_dashboard/api/tuskar.py b/openstack_dashboard/api/tuskar.py
index bebccc70..d2402c8a 100644
--- a/openstack_dashboard/api/tuskar.py
+++ b/openstack_dashboard/api/tuskar.py
@@ -12,22 +12,23 @@
# License for the specific language governing permissions and limitations
# under the License.
-import copy
-import logging
-import re
from collections import namedtuple
-import itertools
+import copy
from datetime import timedelta
+import logging
from random import randint
+import re
from django.conf import settings
-from django.db.models import Sum, Max
+from django.db.models import Max
from django.utils.translation import ugettext_lazy as _
from horizon import exceptions
+from novaclient.v1_1.contrib import baremetal
from tuskarclient.v1 import client as tuskar_client
-from openstack_dashboard.api import base, nova
+from openstack_dashboard.api import base
+from openstack_dashboard.api import nova
import openstack_dashboard.dashboards.infrastructure.models as dummymodels
@@ -156,7 +157,7 @@ class Node(StringIdAPIResourceWrapper):
NOVA_BAREMETAL_CREDS['tenant'],
auth_url=NOVA_BAREMETAL_CREDS['auth_url'],
bypass_url=NOVA_BAREMETAL_CREDS['bypass_url'])
- return nova.baremetal.BareMetalNodeManager(nc)
+ return baremetal.BareMetalNodeManager(nc)
@classmethod
def get(cls, request, node_id):
diff --git a/openstack_dashboard/dashboards/infrastructure/models.py b/openstack_dashboard/dashboards/infrastructure/models.py
index 8097e5b1..11f96a75 100644
--- a/openstack_dashboard/dashboards/infrastructure/models.py
+++ b/openstack_dashboard/dashboards/infrastructure/models.py
@@ -15,9 +15,9 @@
# under the License.
# FIXME: configuration for dummy data
-from django.db import models
-from django.contrib.contenttypes.models import ContentType
from django.contrib.contenttypes import generic
+from django.contrib.contenttypes.models import ContentType
+from django.db import models
class Capacity(models.Model):
diff --git a/openstack_dashboard/dashboards/infrastructure/overview/urls.py b/openstack_dashboard/dashboards/infrastructure/overview/urls.py
index e09af394..5176c21a 100644
--- a/openstack_dashboard/dashboards/infrastructure/overview/urls.py
+++ b/openstack_dashboard/dashboards/infrastructure/overview/urls.py
@@ -17,7 +17,8 @@
from django.conf.urls.defaults import patterns
from django.conf.urls.defaults import url
-from .views import IndexView
+from openstack_dashboard.dashboards.infrastructure. \
+ overview.views import IndexView
urlpatterns = patterns('',
diff --git a/openstack_dashboard/dashboards/infrastructure/resource_management/flavors/tables.py b/openstack_dashboard/dashboards/infrastructure/resource_management/flavors/tables.py
index bbf48c3c..b1a5b975 100644
--- a/openstack_dashboard/dashboards/infrastructure/resource_management/flavors/tables.py
+++ b/openstack_dashboard/dashboards/infrastructure/resource_management/flavors/tables.py
@@ -52,7 +52,7 @@ class FlavorsFilterAction(tables.FilterAction):
def filter(self, table, flavors, filter_string):
""" Naive case-insensitive search. """
q = filter_string.lower()
- return [flavor for flavor in instances
+ return [flavor for flavor in flavors
if q in flavor.name.lower()]
diff --git a/openstack_dashboard/dashboards/infrastructure/resource_management/flavors/urls.py b/openstack_dashboard/dashboards/infrastructure/resource_management/flavors/urls.py
index aca72419..ec485327 100644
--- a/openstack_dashboard/dashboards/infrastructure/resource_management/flavors/urls.py
+++ b/openstack_dashboard/dashboards/infrastructure/resource_management/flavors/urls.py
@@ -13,10 +13,19 @@
# 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, EditView,
- DetailEditView, ActiveInstancesDataView)
+from openstack_dashboard.dashboards.infrastructure. \
+ resource_management.flavors.views import ActiveInstancesDataView
+from openstack_dashboard.dashboards.infrastructure. \
+ resource_management.flavors.views import CreateView
+from openstack_dashboard.dashboards.infrastructure. \
+ resource_management.flavors.views import DetailEditView
+from openstack_dashboard.dashboards.infrastructure. \
+ resource_management.flavors.views import DetailView
+from openstack_dashboard.dashboards.infrastructure. \
+ resource_management.flavors.views import EditView
FLAVORS = r'^(?P<flavor_id>[^/]+)/%s$'
diff --git a/openstack_dashboard/dashboards/infrastructure/resource_management/flavors/views.py b/openstack_dashboard/dashboards/infrastructure/resource_management/flavors/views.py
index ed619917..e66eb3fd 100644
--- a/openstack_dashboard/dashboards/infrastructure/resource_management/flavors/views.py
+++ b/openstack_dashboard/dashboards/infrastructure/resource_management/flavors/views.py
@@ -30,8 +30,12 @@ from horizon import forms
from horizon import tabs
from openstack_dashboard import api
-from .forms import CreateFlavor, EditFlavor
-from .tabs import FlavorDetailTabs
+from openstack_dashboard.dashboards.infrastructure. \
+ resource_management.flavors.forms import CreateFlavor
+from openstack_dashboard.dashboards.infrastructure. \
+ resource_management.flavors.forms import EditFlavor
+from openstack_dashboard.dashboards.infrastructure. \
+ resource_management.flavors.tabs import FlavorDetailTabs
LOG = logging.getLogger(__name__)
diff --git a/openstack_dashboard/dashboards/infrastructure/resource_management/nodes/tests.py b/openstack_dashboard/dashboards/infrastructure/resource_management/nodes/tests.py
index d352605d..aede3fa7 100644
--- a/openstack_dashboard/dashboards/infrastructure/resource_management/nodes/tests.py
+++ b/openstack_dashboard/dashboards/infrastructure/resource_management/nodes/tests.py
@@ -1,6 +1,8 @@
-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/infrastructure/resource_management/nodes/urls.py b/openstack_dashboard/dashboards/infrastructure/resource_management/nodes/urls.py
index cb53400d..faae3945 100644
--- a/openstack_dashboard/dashboards/infrastructure/resource_management/nodes/urls.py
+++ b/openstack_dashboard/dashboards/infrastructure/resource_management/nodes/urls.py
@@ -15,8 +15,10 @@
from django.conf.urls.defaults import patterns
from django.conf.urls.defaults import url
-from .views import DetailView
-from .views import UnrackedView
+from openstack_dashboard.dashboards.infrastructure. \
+ resource_management.nodes.views import DetailView
+from openstack_dashboard.dashboards.infrastructure. \
+ resource_management.nodes.views import UnrackedView
NODES = r'^(?P<node_id>[^/]+)/%s$'
diff --git a/openstack_dashboard/dashboards/infrastructure/resource_management/nodes/views.py b/openstack_dashboard/dashboards/infrastructure/resource_management/nodes/views.py
index ca73a49a..7c492184 100644
--- a/openstack_dashboard/dashboards/infrastructure/resource_management/nodes/views.py
+++ b/openstack_dashboard/dashboards/infrastructure/resource_management/nodes/views.py
@@ -20,9 +20,10 @@ from horizon import tables
from horizon import tabs
from openstack_dashboard import api
-
-from .tabs import NodeDetailTabs
-from .tables import UnrackedNodesTable
+from openstack_dashboard.dashboards.infrastructure. \
+ resource_management.nodes.tables import UnrackedNodesTable
+from openstack_dashboard.dashboards.infrastructure. \
+ resource_management.nodes.tabs import NodeDetailTabs
class UnrackedView(tables.DataTableView):
diff --git a/openstack_dashboard/dashboards/infrastructure/resource_management/racks/tabs.py b/openstack_dashboard/dashboards/infrastructure/resource_management/racks/tabs.py
index c3314623..e4d7ac43 100644
--- a/openstack_dashboard/dashboards/infrastructure/resource_management/racks/tabs.py
+++ b/openstack_dashboard/dashboards/infrastructure/resource_management/racks/tabs.py
@@ -17,7 +17,8 @@ from django.utils.translation import ugettext_lazy as _
from horizon import exceptions
from horizon import tabs
-from ..nodes.tables import NodesTable
+from openstack_dashboard.dashboards.infrastructure. \
+ resource_management.nodes.tables import NodesTable
class OverviewTab(tabs.Tab):
diff --git a/openstack_dashboard/dashboards/infrastructure/resource_management/racks/tests.py b/openstack_dashboard/dashboards/infrastructure/resource_management/racks/tests.py
index 71d422f5..f17f9201 100644
--- a/openstack_dashboard/dashboards/infrastructure/resource_management/racks/tests.py
+++ b/openstack_dashboard/dashboards/infrastructure/resource_management/racks/tests.py
@@ -16,6 +16,8 @@ from django import http
from mox import IgnoreArg
from mox import IsA
+from novaclient.v1_1.contrib import baremetal
+
from openstack_dashboard import api
from openstack_dashboard.test import helpers as test
@@ -47,12 +49,12 @@ class RackViewTests(test.BaseAdminViewTests):
#
@test.create_stubs({api.tuskar.Rack: ('list', 'create',),
api.tuskar.ResourceClass: ('list',),
- api.nova.baremetal.BareMetalNodeManager: ('create',)})
+ baremetal.BareMetalNodeManager: ('create',)})
def test_create_rack_post(self):
api.tuskar.Rack.list(
IsA(http.request.HttpRequest)).AndReturn(
self.tuskar_racks.list())
- api.nova.baremetal.BareMetalNodeManager.create(
+ baremetal.BareMetalNodeManager.create(
'New Node', u'1', u'1024', u'10', 'aa:bb:cc:dd:ee',
u'', u'', u'', u'').AndReturn(None)
api.tuskar.Rack.create(
diff --git a/openstack_dashboard/dashboards/infrastructure/resource_management/racks/urls.py b/openstack_dashboard/dashboards/infrastructure/resource_management/racks/urls.py
index c3bad0e6..dee9d718 100644
--- a/openstack_dashboard/dashboards/infrastructure/resource_management/racks/urls.py
+++ b/openstack_dashboard/dashboards/infrastructure/resource_management/racks/urls.py
@@ -15,8 +15,20 @@
from django.conf.urls import patterns
from django.conf.urls import url
-from .views import (CreateView, UploadView, EditView, DetailEditView,
- EditRackStatusView, DetailView, UsageDataView)
+from openstack_dashboard.dashboards.infrastructure. \
+ resource_management.racks.views import CreateView
+from openstack_dashboard.dashboards.infrastructure. \
+ resource_management.racks.views import DetailEditView
+from openstack_dashboard.dashboards.infrastructure. \
+ resource_management.racks.views import DetailView
+from openstack_dashboard.dashboards.infrastructure. \
+ resource_management.racks.views import EditRackStatusView
+from openstack_dashboard.dashboards.infrastructure. \
+ resource_management.racks.views import EditView
+from openstack_dashboard.dashboards.infrastructure. \
+ resource_management.racks.views import UploadView
+from openstack_dashboard.dashboards.infrastructure. \
+ resource_management.racks.views import UsageDataView
RACKS = r'^(?P<rack_id>[^/]+)/%s$'
diff --git a/openstack_dashboard/dashboards/infrastructure/resource_management/racks/views.py b/openstack_dashboard/dashboards/infrastructure/resource_management/racks/views.py
index e21ca7da..1a7fed7c 100644
--- a/openstack_dashboard/dashboards/infrastructure/resource_management/racks/views.py
+++ b/openstack_dashboard/dashboards/infrastructure/resource_management/racks/views.py
@@ -31,13 +31,22 @@ from horizon import exceptions
from horizon import forms
from horizon import tabs
from horizon import workflows
-from .workflows import (CreateRack, EditRack, DetailEditRack)
from openstack_dashboard import api
-
-from .forms import UploadRack, UpdateRackStatus
-from .tables import UploadRacksTable
-from .tabs import RackDetailTabs
+from openstack_dashboard.dashboards.infrastructure. \
+ resource_management.racks.forms import UpdateRackStatus
+from openstack_dashboard.dashboards.infrastructure. \
+ resource_management.racks.forms import UploadRack
+from openstack_dashboard.dashboards.infrastructure. \
+ resource_management.racks.tabs import RackDetailTabs
+from openstack_dashboard.dashboards.infrastructure. \
+ resource_management.racks.tables import UploadRacksTable
+from openstack_dashboard.dashboards.infrastructure. \
+ resource_management.racks.workflows import CreateRack
+from openstack_dashboard.dashboards.infrastructure. \
+ resource_management.racks.workflows import DetailEditRack
+from openstack_dashboard.dashboards.infrastructure. \
+ resource_management.racks.workflows import EditRack
LOG = logging.getLogger(__name__)
diff --git a/openstack_dashboard/dashboards/infrastructure/resource_management/racks/workflows.py b/openstack_dashboard/dashboards/infrastructure/resource_management/racks/workflows.py
index 7c8c47c2..4c3651a8 100644
--- a/openstack_dashboard/dashboards/infrastructure/resource_management/racks/workflows.py
+++ b/openstack_dashboard/dashboards/infrastructure/resource_management/racks/workflows.py
@@ -65,9 +65,10 @@ class NodeEditAction(NodeCreateAction):
# I want to let it fail, but don't commit like that! :)
def __init__(self, request, *args, **kwargs):
super(NodeEditAction, self).__init__(request, *args, **kwargs)
- rack_id = self.initial['rack_id']
- rack = api.tuskar.Rack.get(request, rack_id)
- nodes = rack.list_nodes
+ # TODO(Resolve node edits)
+ #rack_id = self.initial['rack_id']
+ #rack = api.tuskar.Rack.get(request, rack_id)
+ #nodes = rack.list_nodes
class RackCreateInfoAction(workflows.Action):
@@ -86,8 +87,6 @@ class RackCreateInfoAction(workflows.Action):
cleaned_data = super(RackCreateInfoAction, self).clean()
name = cleaned_data.get('name')
rack_id = self.initial.get('rack_id', None)
- resource_class_id = cleaned_data.get('resource_class_id')
- location = cleaned_data.get('location')
subnet = cleaned_data.get('subnet')
try:
racks = api.tuskar.Rack.list(self.request)
@@ -106,8 +105,8 @@ class RackCreateInfoAction(workflows.Action):
% name)
if rack.subnet == subnet and other_record:
raise forms.ValidationError(
- _('The subnet %s is already assigned to rack %s.')
- % (subnet, rack.name))
+ _('The subnet is already assigned to rack %s.')
+ % (rack.name))
return cleaned_data
@@ -122,11 +121,6 @@ class RackCreateInfoAction(workflows.Action):
name = _("Rack Settings")
-class RackEditInfoAction(RackCreateInfoAction):
- def clean(self):
- cleaned_data = super(RackCreateInfoAction, self).clean()
-
-
class CreateRackInfo(workflows.Step):
action_class = RackCreateInfoAction
@@ -181,14 +175,14 @@ class CreateRack(workflows.Workflow):
node_id = None
# Then, register the Rack, including the node if it exists
- rack = api.tuskar.Rack.create(request, data['name'],
- data['resource_class_id'],
- data['location'],
- data['subnet'],
- [{'id': node_id}])
+ api.tuskar.Rack.create(request, data['name'],
+ data['resource_class_id'],
+ data['location'],
+ data['subnet'],
+ [{'id': node_id}])
return True
- except Exception as ex:
+ except Exception:
exceptions.handle(request, _("Unable to create rack."))
@@ -203,7 +197,7 @@ class EditRack(CreateRack):
def handle(self, request, data):
try:
rack_id = self.context['rack_id']
- rack = api.tuskar.Rack.update(request, rack_id, data)
+ api.tuskar.Rack.update(request, rack_id, data)
return True
except:
exceptions.handle(request, _("Unable to update rack."))
diff --git a/openstack_dashboard/dashboards/infrastructure/resource_management/resource_classes/tables.py b/openstack_dashboard/dashboards/infrastructure/resource_management/resource_classes/tables.py
index 53772586..76fb2c2a 100644
--- a/openstack_dashboard/dashboards/infrastructure/resource_management/resource_classes/tables.py
+++ b/openstack_dashboard/dashboards/infrastructure/resource_management/resource_classes/tables.py
@@ -23,10 +23,12 @@ from horizon import tables
from openstack_dashboard import api
-import workflows
-
-from ..flavors import tables as flavors_tables
-from ..racks import tables as racks_tables
+from openstack_dashboard.dashboards.infrastructure. \
+ resource_management.flavors import tables as flavors_tables
+from openstack_dashboard.dashboards.infrastructure. \
+ resource_management.racks import tables as racks_tables
+from openstack_dashboard.dashboards.infrastructure. \
+ resource_management import resource_classes
LOG = logging.getLogger(__name__)
@@ -138,7 +140,7 @@ class UpdateRacksClass(tables.LinkAction):
urlresolvers.reverse(
url,
args=(self.table.kwargs['resource_class_id'],)),
- workflows.RacksAction.slug)
+ resource_classes.workflows.RacksAction.slug)
class UpdateFlavorsClass(tables.LinkAction):
@@ -153,7 +155,7 @@ class UpdateFlavorsClass(tables.LinkAction):
urlresolvers.reverse(
url,
args=(self.table.kwargs['resource_class_id'],)),
- workflows.ResourceClassInfoAndFlavorsAction.slug)
+ resource_classes.workflows.ResourceClassInfoAndFlavorsAction.slug)
class ResourceClassDetailFlavorsTable(flavors_tables.FlavorsTable):
diff --git a/openstack_dashboard/dashboards/infrastructure/resource_management/resource_classes/tabs.py b/openstack_dashboard/dashboards/infrastructure/resource_management/resource_classes/tabs.py
index 0c2c61ac..8f49d94d 100644
--- a/openstack_dashboard/dashboards/infrastructure/resource_management/resource_classes/tabs.py
+++ b/openstack_dashboard/dashboards/infrastructure/resource_management/resource_classes/tabs.py
@@ -17,8 +17,10 @@ from django.utils.translation import ugettext_lazy as _
from horizon import exceptions
from horizon import tabs
-from tables import RacksTable
-from tables import ResourceClassDetailFlavorsTable
+from openstack_dashboard.dashboards.infrastructure.resource_management. \
+ resource_classes.tables import RacksTable
+from openstack_dashboard.dashboards.infrastructure.resource_management. \
+ resource_classes.tables import ResourceClassDetailFlavorsTable
class OverviewTab(tabs.Tab):
diff --git a/openstack_dashboard/dashboards/infrastructure/resource_management/resource_classes/urls.py b/openstack_dashboard/dashboards/infrastructure/resource_management/resource_classes/urls.py
index 218f0487..389b6311 100644
--- a/openstack_dashboard/dashboards/infrastructure/resource_management/resource_classes/urls.py
+++ b/openstack_dashboard/dashboards/infrastructure/resource_management/resource_classes/urls.py
@@ -15,8 +15,21 @@
from django.conf.urls.defaults import patterns
from django.conf.urls.defaults import url
-from .views import (CreateView, DetailUpdateView, DetailActionView, DetailView,
- UpdateFlavorsView, UpdateRacksView, UpdateView)
+from openstack_dashboard.dashboards.infrastructure. \
+ resource_management.resource_classes.views import CreateView
+from openstack_dashboard.dashboards.infrastructure. \
+ resource_management.resource_classes.views import DetailActionView
+from openstack_dashboard.dashboards.infrastructure. \
+ resource_management.resource_classes.views import DetailUpdateView
+from openstack_dashboard.dashboards.infrastructure. \
+ resource_management.resource_classes.views import DetailView
+from openstack_dashboard.dashboards.infrastructure. \
+ resource_management.resource_classes.views import UpdateFlavorsView
+from openstack_dashboard.dashboards.infrastructure. \
+ resource_management.resource_classes.views import UpdateRacksView
+from openstack_dashboard.dashboards.infrastructure. \
+ resource_management.resource_classes.views import UpdateView
+
RESOURCE_CLASS = r'^(?P<resource_class_id>[^/]+)/%s$'
VIEW_MOD = 'openstack_dashboard.dashboards.infrastructure.' \
diff --git a/openstack_dashboard/dashboards/infrastructure/resource_management/resource_classes/views.py b/openstack_dashboard/dashboards/infrastructure/resource_management/resource_classes/views.py
index a975776e..76974290 100644
--- a/openstack_dashboard/dashboards/infrastructure/resource_management/resource_classes/views.py
+++ b/openstack_dashboard/dashboards/infrastructure/resource_management/resource_classes/views.py
@@ -34,11 +34,21 @@ from horizon import workflows
from openstack_dashboard import api
-from .forms import DeleteForm
-from .workflows import (CreateResourceClass, UpdateResourceClass,
- UpdateRacksWorkflow, UpdateFlavorsWorkflow,
- DetailUpdateWorkflow)
-from .tabs import ResourceClassDetailTabs
+from openstack_dashboard.dashboards.infrastructure. \
+ resource_management.resource_classes.forms import DeleteForm
+from openstack_dashboard.dashboards.infrastructure. \
+ resource_management.resource_classes.tabs import ResourceClassDetailTabs
+from openstack_dashboard.dashboards.infrastructure. \
+ resource_management.resource_classes.workflows import CreateResourceClass
+from openstack_dashboard.dashboards.infrastructure. \
+ resource_management.resource_classes.workflows import DetailUpdateWorkflow
+from openstack_dashboard.dashboards.infrastructure. \
+ resource_management.resource_classes.workflows import UpdateFlavorsWorkflow
+from openstack_dashboard.dashboards.infrastructure. \
+ resource_management.resource_classes.workflows import UpdateRacksWorkflow
+from openstack_dashboard.dashboards.infrastructure. \
+ resource_management.resource_classes.workflows import UpdateResourceClass
+
LOG = logging.getLogger(__name__)
diff --git a/openstack_dashboard/dashboards/infrastructure/resource_management/resource_classes/workflows.py b/openstack_dashboard/dashboards/infrastructure/resource_management/resource_classes/workflows.py
index ac96bf6c..036f10ae 100644
--- a/openstack_dashboard/dashboards/infrastructure/resource_management/resource_classes/workflows.py
+++ b/openstack_dashboard/dashboards/infrastructure/resource_management/resource_classes/workflows.py
@@ -24,8 +24,10 @@ from openstack_dashboard import api
import re
-from .tables import FlavorsTable
-from .tables import RacksTable
+from openstack_dashboard.dashboards.infrastructure. \
+ resource_management.resource_classes.tables import FlavorsTable
+from openstack_dashboard.dashboards.infrastructure. \
+ resource_management.resource_classes.tables import RacksTable
class ResourceClassInfoAndFlavorsAction(workflows.Action):
diff --git a/openstack_dashboard/dashboards/infrastructure/resource_management/tabs.py b/openstack_dashboard/dashboards/infrastructure/resource_management/tabs.py
index a4800022..d21d04e7 100644
--- a/openstack_dashboard/dashboards/infrastructure/resource_management/tabs.py
+++ b/openstack_dashboard/dashboards/infrastructure/resource_management/tabs.py
@@ -17,14 +17,15 @@
from django.utils.translation import ugettext_lazy as _
from horizon import exceptions
-from horizon import messages
from horizon import tabs
from openstack_dashboard.api import tuskar
-
-from .flavors.tables import FlavorsTable
-from .racks.tables import RacksTable
-from .resource_classes.tables import ResourceClassesTable
+from openstack_dashboard.dashboards.infrastructure. \
+ resource_management.flavors.tables import FlavorsTable
+from openstack_dashboard.dashboards.infrastructure. \
+ resource_management.racks.tables import RacksTable
+from openstack_dashboard.dashboards.infrastructure. \
+ resource_management.resource_classes.tables import ResourceClassesTable
class RacksTab(tabs.TableTab):
diff --git a/openstack_dashboard/dashboards/infrastructure/resource_management/urls.py b/openstack_dashboard/dashboards/infrastructure/resource_management/urls.py
index cdd009d9..d41e15be 100644
--- a/openstack_dashboard/dashboards/infrastructure/resource_management/urls.py
+++ b/openstack_dashboard/dashboards/infrastructure/resource_management/urls.py
@@ -18,11 +18,16 @@ from django.conf.urls.defaults import include
from django.conf.urls.defaults import patterns
from django.conf.urls.defaults import url
-from .flavors import urls as flavor_urls
-from .nodes import urls as node_urls
-from .racks import urls as rack_urls
-from .resource_classes import urls as resource_classes_urls
-from .views import IndexView
+from openstack_dashboard.dashboards.infrastructure. \
+ resource_management.flavors import urls as flavor_urls
+from openstack_dashboard.dashboards.infrastructure. \
+ resource_management.nodes import urls as node_urls
+from openstack_dashboard.dashboards.infrastructure. \
+ resource_management.racks import urls as rack_urls
+from openstack_dashboard.dashboards.infrastructure. \
+ resource_management.resource_classes import urls as resource_classes_urls
+from openstack_dashboard.dashboards.infrastructure. \
+ resource_management.views import IndexView
urlpatterns = patterns('',
url(r'^$', IndexView.as_view(), name='index'),
diff --git a/openstack_dashboard/dashboards/infrastructure/resource_management/views.py b/openstack_dashboard/dashboards/infrastructure/resource_management/views.py
index c77b5517..53ef51c0 100644
--- a/openstack_dashboard/dashboards/infrastructure/resource_management/views.py
+++ b/openstack_dashboard/dashboards/infrastructure/resource_management/views.py
@@ -21,7 +21,8 @@ Views for Resource Management.
from horizon import tabs
-from .tabs import ResourceManagementTabs
+from openstack_dashboard.dashboards.infrastructure. \
+ resource_management.tabs import ResourceManagementTabs
class IndexView(tabs.TabbedTableView):
diff --git a/openstack_dashboard/dashboards/infrastructure/service_management/panel.py b/openstack_dashboard/dashboards/infrastructure/service_management/panel.py
index e9cc5411..a91c5ec4 100644
--- a/openstack_dashboard/dashboards/infrastructure/service_management/panel.py
+++ b/openstack_dashboard/dashboards/infrastructure/service_management/panel.py
@@ -18,7 +18,7 @@ from django.utils.translation import ugettext_lazy as _
import horizon
-from openstack_dashboard.dashboards.infrastructure import dashboard
+#from openstack_dashboard.dashboards.infrastructure import dashboard
class Service_Management(horizon.Panel):
diff --git a/openstack_dashboard/dashboards/infrastructure/service_management/urls.py b/openstack_dashboard/dashboards/infrastructure/service_management/urls.py
index d6e4d2d5..8d2a2fde 100644
--- a/openstack_dashboard/dashboards/infrastructure/service_management/urls.py
+++ b/openstack_dashboard/dashboards/infrastructure/service_management/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
+from openstack_dashboard.dashboards.infrastructure. \
+ service_management.views import IndexView
urlpatterns = patterns('',
diff --git a/openstack_dashboard/test/api_tests/tuskar_tests.py b/openstack_dashboard/test/api_tests/tuskar_tests.py
index 4730c44b..59e0d805 100644
--- a/openstack_dashboard/test/api_tests/tuskar_tests.py
+++ b/openstack_dashboard/test/api_tests/tuskar_tests.py
@@ -15,16 +15,8 @@
# under the License.
from __future__ import absolute_import
-
-from django import http
-from django.conf import settings
-from django.test.utils import override_settings
-
-from mox import IsA
-
from openstack_dashboard import api
from openstack_dashboard.test import helpers as test
-import openstack_dashboard.dashboards.infrastructure.models as dummymodels
class TuskarApiTests(test.APITestCase):
@@ -82,7 +74,6 @@ class TuskarApiTests(test.APITestCase):
def test_resource_class_nodes(self):
rc = self.tuskar_resource_classes.first()
r = self.tuskar_racks.first()
- n = self.nodes.first()
tuskarclient = self.stub_tuskarclient()
tuskarclient.racks = self.mox.CreateMockAnything()
@@ -93,7 +84,7 @@ class TuskarApiTests(test.APITestCase):
self.assertIsInstance(node, api.tuskar.Node)
self.assertEquals(4, len(rc.nodes))
- # TODO: create, delete operations
+ # TODO(create, delete operations)
def test_flavor_template_list(self):
templates = api.tuskar.FlavorTemplate.list(self.request)
diff --git a/openstack_dashboard/test/test_data/tuskar_data.py b/openstack_dashboard/test/test_data/tuskar_data.py
index 08c42da7..25e53d63 100644
--- a/openstack_dashboard/test/test_data/tuskar_data.py
+++ b/openstack_dashboard/test/test_data/tuskar_data.py
@@ -10,14 +10,18 @@
# License for the specific language governing permissions and limitations
# under the License.
-from openstack_dashboard.api.tuskar import (
- Flavor, FlavorTemplate, ResourceClass, Node,
- Rack, Capacity)
+from openstack_dashboard.api.tuskar import Capacity
+from openstack_dashboard.api.tuskar import Flavor
+from openstack_dashboard.api.tuskar import FlavorTemplate
+from openstack_dashboard.api.tuskar import Node
+from openstack_dashboard.api.tuskar import Rack
+from openstack_dashboard.api.tuskar import ResourceClass
+
from collections import namedtuple
import openstack_dashboard.dashboards.infrastructure.models as dummymodels
-from .utils import TestDataContainer
+from openstack_dashboard.test.test_data.utils import TestDataContainer
def data(TEST):