Rename resources directory to nodes

Since the 'resources' directory actually deals with
nodes, it makes sense to have consistent terminology.

Change-Id: Icee6656e258d8a5328629b8029a0aaa82fe84efd
This commit is contained in:
Tzu-Mainn Chen 2014-01-07 14:23:57 -05:00
parent 50b1ac52ee
commit 32c4793ffb
22 changed files with 38 additions and 38 deletions

View File

@ -37,13 +37,13 @@ class Deployment(horizon.PanelGroup):
)
class Resources(horizon.PanelGroup):
slug = "resources"
name = _("Resources")
class Nodes(horizon.PanelGroup):
slug = "nodes"
name = _("Nodes")
panels = (
'resources.overview',
'resources.resource',
'resources.free',
'nodes.overview',
'nodes.resource',
'nodes.free',
)
@ -53,7 +53,7 @@ class Infrastructure(horizon.Dashboard):
panels = (
InfrastructureOverview,
Deployment,
Resources,
Nodes,
)
default_panel = 'overview'
permissions = ('openstack.roles.admin',)

View File

@ -19,9 +19,9 @@ import horizon
from tuskar_ui.infrastructure import dashboard
class ResourcesFree(horizon.Panel):
class NodesFree(horizon.Panel):
name = _("Free Nodes")
slug = "resources.free"
slug = "nodes.free"
dashboard.Infrastructure.register(ResourcesFree)
dashboard.Infrastructure.register(NodesFree)

View File

@ -14,7 +14,7 @@
from django.utils.translation import ugettext_lazy as _ # noqa
from tuskar_ui.infrastructure.resources import tables
from tuskar_ui.infrastructure.nodes import tables
class FreeNodesTable(tables.NodesTable):

View File

@ -20,10 +20,10 @@ from tuskar_ui import api
from tuskar_ui.test import helpers as test
INDEX_URL = urlresolvers.reverse('horizon:infrastructure:resources.free'
INDEX_URL = urlresolvers.reverse('horizon:infrastructure:nodes.free'
':index')
RESOURCES_OVERVIEW_URL = urlresolvers.reverse('horizon:infrastructure:'
'resources.overview:index')
NODES_OVERVIEW_URL = urlresolvers.reverse('horizon:infrastructure:'
'nodes.overview:index')
class FreeNodesTests(test.BaseAdminViewTests):
@ -43,7 +43,7 @@ class FreeNodesTests(test.BaseAdminViewTests):
self.maxDiff = None
self.assertTemplateUsed(res,
'infrastructure/resources.free/index.html')
'infrastructure/nodes.free/index.html')
self.assertItemsEqual(res.context['free_nodes_table'].data,
free_nodes)
@ -55,4 +55,4 @@ class FreeNodesTests(test.BaseAdminViewTests):
res = self.client.get(INDEX_URL)
self.assertEqual(mock.list.call_count, 1)
self.assertRedirectsNoFollow(res, RESOURCES_OVERVIEW_URL)
self.assertRedirectsNoFollow(res, NODES_OVERVIEW_URL)

View File

@ -14,7 +14,7 @@
from django.conf.urls import defaults
from tuskar_ui.infrastructure.resources.free import views
from tuskar_ui.infrastructure.nodes.free import views
urlpatterns = defaults.patterns(

View File

@ -19,12 +19,12 @@ from horizon import exceptions
from horizon import tables as horizon_tables
from tuskar_ui import api as tuskar
from tuskar_ui.infrastructure.resources.free import tables
from tuskar_ui.infrastructure.nodes.free import tables
class IndexView(horizon_tables.DataTableView):
table_class = tables.FreeNodesTable
template_name = 'infrastructure/resources.free/index.html'
template_name = 'infrastructure/nodes.free/index.html'
def get_data(self):
try:
@ -32,7 +32,7 @@ class IndexView(horizon_tables.DataTableView):
except Exception:
free_nodes = []
redirect = urlresolvers.reverse(
'horizon:infrastructure:resources.overview:index')
'horizon:infrastructure:nodes.overview:index')
exceptions.handle(self.request,
_('Unable to retrieve free nodes.'),
redirect=redirect)

View File

@ -19,9 +19,9 @@ import horizon
from tuskar_ui.infrastructure import dashboard
class ResourcesOverview(horizon.Panel):
class NodesOverview(horizon.Panel):
name = _("Overview")
slug = "resources.overview"
slug = "nodes.overview"
dashboard.Infrastructure.register(ResourcesOverview)
dashboard.Infrastructure.register(NodesOverview)

View File

@ -14,7 +14,7 @@
from django.conf.urls import defaults
from tuskar_ui.infrastructure.resources.resource import views
from tuskar_ui.infrastructure.nodes.overview import views
urlpatterns = defaults.patterns(

View File

@ -19,9 +19,9 @@ import horizon
from tuskar_ui.infrastructure import dashboard
class ResourcesResource(horizon.Panel):
class NodesResource(horizon.Panel):
name = _("Resource Nodes")
slug = "resources.resource"
slug = "nodes.resource"
dashboard.Infrastructure.register(ResourcesResource)
dashboard.Infrastructure.register(NodesResource)

View File

@ -14,7 +14,7 @@
from django.utils.translation import ugettext_lazy as _ # noqa
from tuskar_ui.infrastructure.resources import tables
from tuskar_ui.infrastructure.nodes import tables
class ResourceNodesTable(tables.NodesTable):

View File

@ -20,10 +20,10 @@ from tuskar_ui import api
from tuskar_ui.test import helpers as test
INDEX_URL = urlresolvers.reverse('horizon:infrastructure:resources.resource'
INDEX_URL = urlresolvers.reverse('horizon:infrastructure:nodes.resource'
':index')
RESOURCES_OVERVIEW_URL = urlresolvers.reverse('horizon:infrastructure:'
'resources.overview:index')
NODES_OVERVIEW_URL = urlresolvers.reverse('horizon:infrastructure:'
'nodes.overview:index')
class ResourceNodesTests(test.BaseAdminViewTests):
@ -43,7 +43,7 @@ class ResourceNodesTests(test.BaseAdminViewTests):
self.maxDiff = None
self.assertTemplateUsed(
res, 'infrastructure/resources.resource/index.html')
res, 'infrastructure/nodes.resource/index.html')
self.assertItemsEqual(res.context['resource_nodes_table'].data,
resource_nodes)
@ -56,4 +56,4 @@ class ResourceNodesTests(test.BaseAdminViewTests):
res = self.client.get(INDEX_URL)
self.assertEqual(mock.list.call_count, 1)
self.assertRedirectsNoFollow(res, RESOURCES_OVERVIEW_URL)
self.assertRedirectsNoFollow(res, NODES_OVERVIEW_URL)

View File

@ -14,7 +14,7 @@
from django.conf.urls import defaults
from tuskar_ui.infrastructure.resources.overview import views
from tuskar_ui.infrastructure.nodes.resource import views
urlpatterns = defaults.patterns(

View File

@ -19,12 +19,12 @@ from horizon import exceptions
from horizon import tables as horizon_tables
from tuskar_ui import api as tuskar
from tuskar_ui.infrastructure.resources.resource import tables
from tuskar_ui.infrastructure.nodes.resource import tables
class IndexView(horizon_tables.DataTableView):
table_class = tables.ResourceNodesTable
template_name = 'infrastructure/resources.resource/index.html'
template_name = 'infrastructure/nodes.resource/index.html'
def get_data(self):
try:
@ -32,7 +32,7 @@ class IndexView(horizon_tables.DataTableView):
except Exception:
resource_nodes = []
redirect = urlresolvers.reverse(
'horizon:infrastructure:resources.overview:index')
'horizon:infrastructure:nodes.overview:index')
exceptions.handle(self.request,
_('Unable to retrieve resource nodes.'),
redirect=redirect)

View File

@ -7,7 +7,7 @@
<div class="breadcrumbs">
<a href="{% url 'horizon:infrastructure:overview:index' %}">{% trans "Infrastructure" %}</a>
<span class="separator"></span>
<a href="{% url 'horizon:infrastructure:resources.overview:index' %}">{% trans "Resources" %}</a>
<a href="{% url 'horizon:infrastructure:nodes.overview:index' %}">{% trans "Nodes" %}</a>
<span class="separator"></span>
</div>