diff --git a/horizon/dashboards/nova/__init__.py b/horizon/dashboards/admin/__init__.py similarity index 100% rename from horizon/dashboards/nova/__init__.py rename to horizon/dashboards/admin/__init__.py diff --git a/horizon/dashboards/syspanel/dashboard.py b/horizon/dashboards/admin/dashboard.py similarity index 90% rename from horizon/dashboards/syspanel/dashboard.py rename to horizon/dashboards/admin/dashboard.py index a25c9fca4..5eaf66f8c 100644 --- a/horizon/dashboards/syspanel/dashboard.py +++ b/horizon/dashboards/admin/dashboard.py @@ -20,18 +20,18 @@ import horizon class SystemPanels(horizon.PanelGroup): - slug = "syspanel" + slug = "admin" name = _("System Panel") panels = ('overview', 'instances', 'volumes', 'services', 'flavors', 'images', 'projects', 'users', 'quotas', 'networks',) -class Syspanel(horizon.Dashboard): +class Admin(horizon.Dashboard): name = _("Admin") - slug = "syspanel" + slug = "admin" panels = (SystemPanels,) default_panel = 'overview' permissions = ('openstack.roles.admin',) -horizon.register(Syspanel) +horizon.register(Admin) diff --git a/horizon/dashboards/nova/access_and_security/__init__.py b/horizon/dashboards/admin/flavors/__init__.py similarity index 100% rename from horizon/dashboards/nova/access_and_security/__init__.py rename to horizon/dashboards/admin/flavors/__init__.py diff --git a/horizon/dashboards/syspanel/flavors/forms.py b/horizon/dashboards/admin/flavors/forms.py similarity index 100% rename from horizon/dashboards/syspanel/flavors/forms.py rename to horizon/dashboards/admin/flavors/forms.py diff --git a/horizon/dashboards/syspanel/flavors/panel.py b/horizon/dashboards/admin/flavors/panel.py similarity index 91% rename from horizon/dashboards/syspanel/flavors/panel.py rename to horizon/dashboards/admin/flavors/panel.py index 843e6bff5..b09a1457b 100644 --- a/horizon/dashboards/syspanel/flavors/panel.py +++ b/horizon/dashboards/admin/flavors/panel.py @@ -21,7 +21,7 @@ from django.utils.translation import ugettext_lazy as _ import horizon -from horizon.dashboards.syspanel import dashboard +from horizon.dashboards.admin import dashboard class Flavors(horizon.Panel): @@ -29,4 +29,4 @@ class Flavors(horizon.Panel): slug = 'flavors' -dashboard.Syspanel.register(Flavors) +dashboard.Admin.register(Flavors) diff --git a/horizon/dashboards/syspanel/flavors/tables.py b/horizon/dashboards/admin/flavors/tables.py similarity index 94% rename from horizon/dashboards/syspanel/flavors/tables.py rename to horizon/dashboards/admin/flavors/tables.py index efa9b5f6d..5084c6c4b 100644 --- a/horizon/dashboards/syspanel/flavors/tables.py +++ b/horizon/dashboards/admin/flavors/tables.py @@ -20,14 +20,14 @@ class DeleteFlavor(tables.DeleteAction): class CreateFlavor(tables.LinkAction): name = "create" verbose_name = _("Create Flavor") - url = "horizon:syspanel:flavors:create" + url = "horizon:admin:flavors:create" classes = ("ajax-modal", "btn-create") class EditFlavor(tables.LinkAction): name = "edit" verbose_name = _("Edit Flavor") - url = "horizon:syspanel:flavors:edit" + url = "horizon:admin:flavors:edit" classes = ("ajax-modal", "btn-edit") diff --git a/horizon/dashboards/syspanel/flavors/templates/flavors/_create.html b/horizon/dashboards/admin/flavors/templates/flavors/_create.html similarity index 77% rename from horizon/dashboards/syspanel/flavors/templates/flavors/_create.html rename to horizon/dashboards/admin/flavors/templates/flavors/_create.html index 7dead7928..da6777bbe 100644 --- a/horizon/dashboards/syspanel/flavors/templates/flavors/_create.html +++ b/horizon/dashboards/admin/flavors/templates/flavors/_create.html @@ -2,7 +2,7 @@ {% load i18n %} {% block form_id %}create_flavor_form{% endblock %} -{% block form_action %}{% url horizon:syspanel:flavors:create %}{% endblock %} +{% block form_action %}{% url horizon:admin:flavors:create %}{% endblock %} {% block modal_id %}create_flavor_modal{% endblock %} {% block modal-header %}{% trans "Create Flavor" %}{% endblock %} @@ -21,5 +21,5 @@ {% block modal-footer %} - {% trans "Cancel" %} + {% trans "Cancel" %} {% endblock %} diff --git a/horizon/dashboards/syspanel/flavors/templates/flavors/_edit.html b/horizon/dashboards/admin/flavors/templates/flavors/_edit.html similarity index 79% rename from horizon/dashboards/syspanel/flavors/templates/flavors/_edit.html rename to horizon/dashboards/admin/flavors/templates/flavors/_edit.html index fc31b69af..b249ff027 100644 --- a/horizon/dashboards/syspanel/flavors/templates/flavors/_edit.html +++ b/horizon/dashboards/admin/flavors/templates/flavors/_edit.html @@ -2,7 +2,7 @@ {% load i18n %} {% block form_id %}edit_flavor_form{% endblock %} -{% block form_action %}{% url horizon:syspanel:flavors:edit flavor_id %}{% endblock %} +{% block form_action %}{% url horizon:admin:flavors:edit flavor_id %}{% endblock %} {% block modal_id %}edit_flavor_modal{% endblock %} {% block modal-header %}{% trans "Edit Flavor" %}{% endblock %} @@ -22,5 +22,5 @@ {% block modal-footer %} - {% trans "Cancel" %} + {% trans "Cancel" %} {% endblock %} diff --git a/horizon/dashboards/syspanel/flavors/templates/flavors/create.html b/horizon/dashboards/admin/flavors/templates/flavors/create.html similarity index 84% rename from horizon/dashboards/syspanel/flavors/templates/flavors/create.html rename to horizon/dashboards/admin/flavors/templates/flavors/create.html index d8c6b0364..377ed0e67 100644 --- a/horizon/dashboards/syspanel/flavors/templates/flavors/create.html +++ b/horizon/dashboards/admin/flavors/templates/flavors/create.html @@ -7,5 +7,5 @@ {% endblock page_header %} {% block main %} - {% include "syspanel/flavors/_create.html" %} + {% include "admin/flavors/_create.html" %} {% endblock %} diff --git a/horizon/dashboards/syspanel/flavors/templates/flavors/edit.html b/horizon/dashboards/admin/flavors/templates/flavors/edit.html similarity index 84% rename from horizon/dashboards/syspanel/flavors/templates/flavors/edit.html rename to horizon/dashboards/admin/flavors/templates/flavors/edit.html index 3076a5902..8a634b44b 100644 --- a/horizon/dashboards/syspanel/flavors/templates/flavors/edit.html +++ b/horizon/dashboards/admin/flavors/templates/flavors/edit.html @@ -7,5 +7,5 @@ {% endblock page_header %} {% block main %} - {% include "syspanel/flavors/_edit.html" %} + {% include "admin/flavors/_edit.html" %} {% endblock %} diff --git a/horizon/dashboards/syspanel/flavors/templates/flavors/index.html b/horizon/dashboards/admin/flavors/templates/flavors/index.html similarity index 100% rename from horizon/dashboards/syspanel/flavors/templates/flavors/index.html rename to horizon/dashboards/admin/flavors/templates/flavors/index.html diff --git a/horizon/dashboards/syspanel/flavors/tests.py b/horizon/dashboards/admin/flavors/tests.py similarity index 87% rename from horizon/dashboards/syspanel/flavors/tests.py rename to horizon/dashboards/admin/flavors/tests.py index a9cd605d3..c91054764 100644 --- a/horizon/dashboards/syspanel/flavors/tests.py +++ b/horizon/dashboards/admin/flavors/tests.py @@ -24,10 +24,10 @@ class FlavorsTests(test.BaseAdminViewTests): ephemeral=eph).AndReturn(flavor) self.mox.ReplayAll() - url = reverse('horizon:syspanel:flavors:create') + url = reverse('horizon:admin:flavors:create') resp = self.client.get(url) self.assertEqual(resp.status_code, 200) - self.assertTemplateUsed(resp, "syspanel/flavors/create.html") + self.assertTemplateUsed(resp, "admin/flavors/create.html") data = {'name': flavor.name, 'vcpus': flavor.vcpus, @@ -36,7 +36,7 @@ class FlavorsTests(test.BaseAdminViewTests): 'eph_gb': eph} resp = self.client.post(url, data) self.assertRedirectsNoFollow(resp, - reverse("horizon:syspanel:flavors:index")) + reverse("horizon:admin:flavors:index")) def test_edit_flavor(self): flavors = self.flavors.list() @@ -65,10 +65,10 @@ class FlavorsTests(test.BaseAdminViewTests): ephemeral=eph).AndReturn(flavor) self.mox.ReplayAll() - url = reverse('horizon:syspanel:flavors:edit', args=[flavor.id]) + url = reverse('horizon:admin:flavors:edit', args=[flavor.id]) resp = self.client.get(url) self.assertEqual(resp.status_code, 200) - self.assertTemplateUsed(resp, "syspanel/flavors/edit.html") + self.assertTemplateUsed(resp, "admin/flavors/edit.html") data = {'flavor_id': flavor.id, 'name': flavor.name, @@ -78,4 +78,4 @@ class FlavorsTests(test.BaseAdminViewTests): 'eph_gb': eph} resp = self.client.post(url, data) self.assertRedirectsNoFollow(resp, - reverse("horizon:syspanel:flavors:index")) + reverse("horizon:admin:flavors:index")) diff --git a/horizon/dashboards/syspanel/flavors/urls.py b/horizon/dashboards/admin/flavors/urls.py similarity index 94% rename from horizon/dashboards/syspanel/flavors/urls.py rename to horizon/dashboards/admin/flavors/urls.py index 5d80fa7dd..6ce1df556 100644 --- a/horizon/dashboards/syspanel/flavors/urls.py +++ b/horizon/dashboards/admin/flavors/urls.py @@ -21,7 +21,7 @@ from django.conf.urls.defaults import patterns, url from .views import IndexView, CreateView, EditView -urlpatterns = patterns('horizon.dashboards.syspanel.flavors.views', +urlpatterns = patterns('horizon.dashboards.admin.flavors.views', url(r'^$', IndexView.as_view(), name='index'), url(r'^create/$', CreateView.as_view(), name='create'), url(r'^(?P[^/]+)/edit/$', EditView.as_view(), name='edit') diff --git a/horizon/dashboards/syspanel/flavors/views.py b/horizon/dashboards/admin/flavors/views.py similarity index 89% rename from horizon/dashboards/syspanel/flavors/views.py rename to horizon/dashboards/admin/flavors/views.py index c54c5ddaf..4a43fa6d9 100644 --- a/horizon/dashboards/syspanel/flavors/views.py +++ b/horizon/dashboards/admin/flavors/views.py @@ -36,7 +36,7 @@ LOG = logging.getLogger(__name__) class IndexView(tables.DataTableView): table_class = FlavorsTable - template_name = 'syspanel/flavors/index.html' + template_name = 'admin/flavors/index.html' def get_data(self): request = self.request @@ -53,14 +53,14 @@ class IndexView(tables.DataTableView): class CreateView(forms.ModalFormView): form_class = CreateFlavor - template_name = 'syspanel/flavors/create.html' - success_url = reverse_lazy('horizon:syspanel:flavors:index') + template_name = 'admin/flavors/create.html' + success_url = reverse_lazy('horizon:admin:flavors:index') class EditView(forms.ModalFormView): form_class = EditFlavor - template_name = 'syspanel/flavors/edit.html' - success_url = reverse_lazy('horizon:syspanel:flavors:index') + template_name = 'admin/flavors/edit.html' + success_url = reverse_lazy('horizon:admin:flavors:index') def get_context_data(self, **kwargs): context = super(EditView, self).get_context_data(**kwargs) diff --git a/horizon/dashboards/nova/access_and_security/floating_ips/__init__.py b/horizon/dashboards/admin/images/__init__.py similarity index 100% rename from horizon/dashboards/nova/access_and_security/floating_ips/__init__.py rename to horizon/dashboards/admin/images/__init__.py diff --git a/horizon/dashboards/syspanel/images/forms.py b/horizon/dashboards/admin/images/forms.py similarity index 92% rename from horizon/dashboards/syspanel/images/forms.py rename to horizon/dashboards/admin/images/forms.py index a9ce1eda8..d983db7a8 100644 --- a/horizon/dashboards/syspanel/images/forms.py +++ b/horizon/dashboards/admin/images/forms.py @@ -18,7 +18,7 @@ # License for the specific language governing permissions and limitations # under the License. -from horizon.dashboards.nova.images_and_snapshots.images import forms +from horizon.dashboards.project.images_and_snapshots.images import forms class AdminUpdateImageForm(forms.UpdateImageForm): diff --git a/horizon/dashboards/syspanel/images/panel.py b/horizon/dashboards/admin/images/panel.py similarity index 91% rename from horizon/dashboards/syspanel/images/panel.py rename to horizon/dashboards/admin/images/panel.py index 55ff0add0..6aefe8ddb 100644 --- a/horizon/dashboards/syspanel/images/panel.py +++ b/horizon/dashboards/admin/images/panel.py @@ -21,7 +21,7 @@ from django.utils.translation import ugettext_lazy as _ import horizon -from horizon.dashboards.syspanel import dashboard +from horizon.dashboards.admin import dashboard class Images(horizon.Panel): @@ -29,4 +29,4 @@ class Images(horizon.Panel): slug = 'images' -dashboard.Syspanel.register(Images) +dashboard.Admin.register(Images) diff --git a/horizon/dashboards/syspanel/images/tables.py b/horizon/dashboards/admin/images/tables.py similarity index 87% rename from horizon/dashboards/syspanel/images/tables.py rename to horizon/dashboards/admin/images/tables.py index d827105d1..ac7c619cf 100644 --- a/horizon/dashboards/syspanel/images/tables.py +++ b/horizon/dashboards/admin/images/tables.py @@ -17,7 +17,7 @@ from django.utils.translation import ugettext_lazy as _ from horizon import tables -from horizon.dashboards.nova.images_and_snapshots.images.tables import ( +from horizon.dashboards.project.images_and_snapshots.images.tables import ( ImagesTable, EditImage, DeleteImage) @@ -27,7 +27,7 @@ class AdminDeleteImage(DeleteImage): class AdminEditImage(EditImage): - url = "horizon:syspanel:images:update" + url = "horizon:admin:images:update" def allowed(self, request, image=None): return True @@ -35,7 +35,7 @@ class AdminEditImage(EditImage): class AdminImagesTable(ImagesTable): name = tables.Column("name", - link="horizon:syspanel:images:detail", + link="horizon:admin:images:detail", verbose_name=_("Image Name")) class Meta: diff --git a/horizon/dashboards/syspanel/images/templates/images/_update.html b/horizon/dashboards/admin/images/templates/images/_update.html similarity index 77% rename from horizon/dashboards/syspanel/images/templates/images/_update.html rename to horizon/dashboards/admin/images/templates/images/_update.html index 80e661c29..764f6088b 100644 --- a/horizon/dashboards/syspanel/images/templates/images/_update.html +++ b/horizon/dashboards/admin/images/templates/images/_update.html @@ -2,7 +2,7 @@ {% load i18n %} {% block form_id %}update_image_form{% endblock %} -{% block form_action %}{% url horizon:syspanel:images:update image.id %}{% endblock %} +{% block form_action %}{% url horizon:admin:images:update image.id %}{% endblock %} {% block modal_id %}update_image_modal{% endblock %} {% block modal-header %}{% trans "Update Image" %}{% endblock %} @@ -21,5 +21,5 @@ {% block modal-footer %} - {% trans "Cancel" %} + {% trans "Cancel" %} {% endblock %} diff --git a/horizon/dashboards/syspanel/images/templates/images/index.html b/horizon/dashboards/admin/images/templates/images/index.html similarity index 100% rename from horizon/dashboards/syspanel/images/templates/images/index.html rename to horizon/dashboards/admin/images/templates/images/index.html diff --git a/horizon/dashboards/syspanel/images/templates/images/update.html b/horizon/dashboards/admin/images/templates/images/update.html similarity index 84% rename from horizon/dashboards/syspanel/images/templates/images/update.html rename to horizon/dashboards/admin/images/templates/images/update.html index a1512e0c4..e81c679bf 100644 --- a/horizon/dashboards/syspanel/images/templates/images/update.html +++ b/horizon/dashboards/admin/images/templates/images/update.html @@ -8,5 +8,5 @@ {% endblock page_header %} {% block main %} - {% include 'syspanel/images/_update.html' %} + {% include 'admin/images/_update.html' %} {% endblock %} diff --git a/horizon/dashboards/syspanel/images/tests.py b/horizon/dashboards/admin/images/tests.py similarity index 90% rename from horizon/dashboards/syspanel/images/tests.py rename to horizon/dashboards/admin/images/tests.py index 22aaad370..6d158065e 100644 --- a/horizon/dashboards/syspanel/images/tests.py +++ b/horizon/dashboards/admin/images/tests.py @@ -34,8 +34,8 @@ class ImagesViewTest(test.BaseAdminViewTests): self.mox.ReplayAll() res = self.client.get( - reverse('horizon:syspanel:images:index')) - self.assertTemplateUsed(res, 'syspanel/images/index.html') + reverse('horizon:admin:images:index')) + self.assertTemplateUsed(res, 'admin/images/index.html') self.assertEqual(len(res.context['images_table'].data), len(self.images.list())) @@ -59,12 +59,12 @@ class ImagesViewTest(test.BaseAdminViewTests): True]) self.mox.ReplayAll() - url = reverse('horizon:syspanel:images:index') + url = reverse('horizon:admin:images:index') res = self.client.get(url) # get all self.assertEqual(len(res.context['images_table'].data), len(self.images.list())) - self.assertTemplateUsed(res, 'syspanel/images/index.html') + self.assertTemplateUsed(res, 'admin/images/index.html') page_size = getattr(settings, "API_RESULT_PAGE_SIZE", None) settings.API_RESULT_PAGE_SIZE = 2 @@ -74,7 +74,7 @@ class ImagesViewTest(test.BaseAdminViewTests): self.assertEqual(len(res.context['images_table'].data), settings.API_RESULT_PAGE_SIZE) - url = "?".join([reverse('horizon:syspanel:images:index'), + url = "?".join([reverse('horizon:admin:images:index'), "=".join([AdminImagesTable._meta.pagination_param, self.images.list()[2].id])]) res = self.client.get(url) @@ -82,7 +82,7 @@ class ImagesViewTest(test.BaseAdminViewTests): self.assertEqual(len(res.context['images_table'].data), settings.API_RESULT_PAGE_SIZE) - url = "?".join([reverse('horizon:syspanel:images:index'), + url = "?".join([reverse('horizon:admin:images:index'), "=".join([AdminImagesTable._meta.pagination_param, self.images.list()[4].id])]) res = self.client.get(url) diff --git a/horizon/dashboards/syspanel/images/urls.py b/horizon/dashboards/admin/images/urls.py similarity index 94% rename from horizon/dashboards/syspanel/images/urls.py rename to horizon/dashboards/admin/images/urls.py index 9e04e13d4..ec07ac1b9 100644 --- a/horizon/dashboards/syspanel/images/urls.py +++ b/horizon/dashboards/admin/images/urls.py @@ -23,7 +23,7 @@ from django.conf.urls.defaults import patterns, url from .views import IndexView, UpdateView, DetailView -urlpatterns = patterns('horizon.dashboards.syspanel.images.views', +urlpatterns = patterns('horizon.dashboards.admin.images.views', url(r'^images/$', IndexView.as_view(), name='index'), url(r'^(?P[^/]+)/update/$', UpdateView.as_view(), name='update'), url(r'^(?P[^/]+)/detail/$', DetailView.as_view(), name='detail') diff --git a/horizon/dashboards/syspanel/images/views.py b/horizon/dashboards/admin/images/views.py similarity index 89% rename from horizon/dashboards/syspanel/images/views.py rename to horizon/dashboards/admin/images/views.py index 036707748..84186696a 100644 --- a/horizon/dashboards/syspanel/images/views.py +++ b/horizon/dashboards/admin/images/views.py @@ -26,7 +26,7 @@ from django.utils.translation import ugettext_lazy as _ from horizon import api from horizon import exceptions from horizon import tables -from horizon.dashboards.nova.images_and_snapshots.images import views +from horizon.dashboards.project.images_and_snapshots.images import views from .tables import AdminImagesTable from .forms import AdminUpdateImageForm @@ -36,7 +36,7 @@ LOG = logging.getLogger(__name__) class IndexView(tables.DataTableView): table_class = AdminImagesTable - template_name = 'syspanel/images/index.html' + template_name = 'admin/images/index.html' def has_more_data(self, table): return self._more @@ -56,9 +56,9 @@ class IndexView(tables.DataTableView): class UpdateView(views.UpdateView): - template_name = 'syspanel/images/update.html' + template_name = 'admin/images/update.html' form_class = AdminUpdateImageForm - success_url = reverse_lazy('horizon:syspanel:images:index') + success_url = reverse_lazy('horizon:admin:images:index') class DetailView(views.DetailView): diff --git a/horizon/dashboards/nova/access_and_security/keypairs/__init__.py b/horizon/dashboards/admin/instances/__init__.py similarity index 100% rename from horizon/dashboards/nova/access_and_security/keypairs/__init__.py rename to horizon/dashboards/admin/instances/__init__.py diff --git a/horizon/dashboards/syspanel/instances/panel.py b/horizon/dashboards/admin/instances/panel.py similarity index 91% rename from horizon/dashboards/syspanel/instances/panel.py rename to horizon/dashboards/admin/instances/panel.py index a9f6cce9b..bbc101a39 100644 --- a/horizon/dashboards/syspanel/instances/panel.py +++ b/horizon/dashboards/admin/instances/panel.py @@ -21,7 +21,7 @@ from django.utils.translation import ugettext_lazy as _ import horizon -from horizon.dashboards.syspanel import dashboard +from horizon.dashboards.admin import dashboard class Instances(horizon.Panel): @@ -30,4 +30,4 @@ class Instances(horizon.Panel): permissions = ('openstack.roles.admin',) -dashboard.Syspanel.register(Instances) +dashboard.Admin.register(Instances) diff --git a/horizon/dashboards/syspanel/instances/tables.py b/horizon/dashboards/admin/instances/tables.py similarity index 95% rename from horizon/dashboards/syspanel/instances/tables.py rename to horizon/dashboards/admin/instances/tables.py index d5b7e6279..7f2c6a577 100644 --- a/horizon/dashboards/syspanel/instances/tables.py +++ b/horizon/dashboards/admin/instances/tables.py @@ -22,7 +22,7 @@ from django.utils.translation import ugettext_lazy as _ from horizon import api from horizon import tables -from horizon.dashboards.nova.instances.tables import (TerminateInstance, +from horizon.dashboards.project.instances.tables import (TerminateInstance, EditInstance, ConsoleLink, LogLink, CreateSnapshot, TogglePause, ToggleSuspend, RebootInstance, get_size, UpdateRow, get_ips, get_power_state) @@ -41,7 +41,7 @@ class AdminUpdateRow(UpdateRow): return instance -class SyspanelInstancesTable(tables.DataTable): +class AdminInstancesTable(tables.DataTable): TASK_STATUS_CHOICES = ( (None, True), ("none", True) @@ -66,7 +66,7 @@ class SyspanelInstancesTable(tables.DataTable): verbose_name=_("Host"), classes=('nowrap-col',)) name = tables.Column("name", - link=("horizon:nova:instances:detail"), + link=("horizon:project:instances:detail"), verbose_name=_("Instance Name")) ip = tables.Column(get_ips, verbose_name=_("IP Address")) size = tables.Column(get_size, diff --git a/horizon/dashboards/syspanel/instances/templates/instances/index.html b/horizon/dashboards/admin/instances/templates/instances/index.html similarity index 100% rename from horizon/dashboards/syspanel/instances/templates/instances/index.html rename to horizon/dashboards/admin/instances/templates/instances/index.html diff --git a/horizon/dashboards/syspanel/instances/tests.py b/horizon/dashboards/admin/instances/tests.py similarity index 89% rename from horizon/dashboards/syspanel/instances/tests.py rename to horizon/dashboards/admin/instances/tests.py index bbfd93c88..64cbee673 100644 --- a/horizon/dashboards/syspanel/instances/tests.py +++ b/horizon/dashboards/admin/instances/tests.py @@ -40,8 +40,8 @@ class InstanceViewTest(test.BaseAdminViewTests): api.nova.flavor_list(IsA(http.HttpRequest)).AndReturn(flavors) self.mox.ReplayAll() - res = self.client.get(reverse('horizon:syspanel:instances:index')) - self.assertTemplateUsed(res, 'syspanel/instances/index.html') + res = self.client.get(reverse('horizon:admin:instances:index')) + self.assertTemplateUsed(res, 'admin/instances/index.html') instances = res.context['table'].data self.assertItemsEqual(instances, servers) @@ -66,8 +66,8 @@ class InstanceViewTest(test.BaseAdminViewTests): self.mox.ReplayAll() - res = self.client.get(reverse('horizon:syspanel:instances:index')) - self.assertTemplateUsed(res, 'syspanel/instances/index.html') + res = self.client.get(reverse('horizon:admin:instances:index')) + self.assertTemplateUsed(res, 'admin/instances/index.html') instances = res.context['table'].data self.assertItemsEqual(instances, servers) @@ -94,9 +94,9 @@ class InstanceViewTest(test.BaseAdminViewTests): AndRaise(self.exceptions.nova) self.mox.ReplayAll() - res = self.client.get(reverse('horizon:syspanel:instances:index')) + res = self.client.get(reverse('horizon:admin:instances:index')) instances = res.context['table'].data - self.assertTemplateUsed(res, 'syspanel/instances/index.html') + self.assertTemplateUsed(res, 'admin/instances/index.html') self.assertMessageCount(res, error=len(servers)) self.assertItemsEqual(instances, servers) @@ -107,8 +107,8 @@ class InstanceViewTest(test.BaseAdminViewTests): self.mox.ReplayAll() - res = self.client.get(reverse('horizon:syspanel:instances:index')) - self.assertTemplateUsed(res, 'syspanel/instances/index.html') + res = self.client.get(reverse('horizon:admin:instances:index')) + self.assertTemplateUsed(res, 'admin/instances/index.html') self.assertEqual(len(res.context['instances_table'].data), 0) @test.create_stubs({api: ('server_get', 'flavor_get',), @@ -126,7 +126,7 @@ class InstanceViewTest(test.BaseAdminViewTests): admin=True).AndReturn(tenant) self.mox.ReplayAll() - url = reverse('horizon:syspanel:instances:index') + \ + url = reverse('horizon:admin:instances:index') + \ "?action=row_update&table=instances&obj_id=" + server.id res = self.client.get(url, {}, diff --git a/horizon/dashboards/syspanel/instances/urls.py b/horizon/dashboards/admin/instances/urls.py similarity index 94% rename from horizon/dashboards/syspanel/instances/urls.py rename to horizon/dashboards/admin/instances/urls.py index d87cd66b0..b7c9a9061 100644 --- a/horizon/dashboards/syspanel/instances/urls.py +++ b/horizon/dashboards/admin/instances/urls.py @@ -26,7 +26,7 @@ from .views import DetailView, AdminIndexView INSTANCES = r'^(?P[^/]+)/%s$' -urlpatterns = patterns('horizon.dashboards.syspanel.instances.views', +urlpatterns = patterns('horizon.dashboards.admin.instances.views', url(r'^$', AdminIndexView.as_view(), name='index'), url(INSTANCES % 'detail', DetailView.as_view(), name='detail'), url(INSTANCES % 'console', 'console', name='console'), diff --git a/horizon/dashboards/syspanel/instances/views.py b/horizon/dashboards/admin/instances/views.py similarity index 92% rename from horizon/dashboards/syspanel/instances/views.py rename to horizon/dashboards/admin/instances/views.py index fbbde0da7..500b0c51a 100644 --- a/horizon/dashboards/syspanel/instances/views.py +++ b/horizon/dashboards/admin/instances/views.py @@ -27,15 +27,15 @@ from django.utils.translation import ugettext_lazy as _ from horizon import api from horizon import exceptions from horizon import tables -from horizon.dashboards.syspanel.instances.tables import SyspanelInstancesTable -from horizon.dashboards.nova.instances.views import console, DetailView, vnc +from horizon.dashboards.admin.instances.tables import AdminInstancesTable +from horizon.dashboards.project.instances.views import console, DetailView, vnc LOG = logging.getLogger(__name__) class AdminIndexView(tables.DataTableView): - table_class = SyspanelInstancesTable - template_name = 'syspanel/instances/index.html' + table_class = AdminInstancesTable + template_name = 'admin/instances/index.html' def get_data(self): instances = [] diff --git a/horizon/dashboards/nova/models.py b/horizon/dashboards/admin/models.py similarity index 100% rename from horizon/dashboards/nova/models.py rename to horizon/dashboards/admin/models.py diff --git a/horizon/dashboards/nova/access_and_security/security_groups/__init__.py b/horizon/dashboards/admin/networks/__init__.py similarity index 100% rename from horizon/dashboards/nova/access_and_security/security_groups/__init__.py rename to horizon/dashboards/admin/networks/__init__.py diff --git a/horizon/dashboards/syspanel/networks/forms.py b/horizon/dashboards/admin/networks/forms.py similarity index 96% rename from horizon/dashboards/syspanel/networks/forms.py rename to horizon/dashboards/admin/networks/forms.py index f6ed33687..c67843333 100644 --- a/horizon/dashboards/syspanel/networks/forms.py +++ b/horizon/dashboards/admin/networks/forms.py @@ -59,7 +59,7 @@ class CreateNetwork(forms.SelfHandlingForm): messages.success(request, msg) return network except: - redirect = reverse('horizon:syspanel:networks:index') + redirect = reverse('horizon:admin:networks:index') msg = _('Failed to create network %s') % data['name'] exceptions.handle(request, msg, redirect=redirect) @@ -71,7 +71,7 @@ class UpdateNetwork(forms.SelfHandlingForm): widget=forms.TextInput( attrs={'readonly': 'readonly'})) shared = forms.BooleanField(label=_("Shared"), required=False) - failure_url = 'horizon:syspanel:networks:index' + failure_url = 'horizon:admin:networks:index' def handle(self, request, data): try: diff --git a/horizon/dashboards/nova/networks/panel.py b/horizon/dashboards/admin/networks/panel.py similarity index 91% rename from horizon/dashboards/nova/networks/panel.py rename to horizon/dashboards/admin/networks/panel.py index e4270bec4..ccf751e49 100644 --- a/horizon/dashboards/nova/networks/panel.py +++ b/horizon/dashboards/admin/networks/panel.py @@ -17,7 +17,7 @@ from django.utils.translation import ugettext_lazy as _ import horizon -from horizon.dashboards.nova import dashboard +from horizon.dashboards.admin import dashboard class Networks(horizon.Panel): @@ -25,4 +25,4 @@ class Networks(horizon.Panel): slug = 'networks' permissions = ('openstack.services.network',) -dashboard.Nova.register(Networks) +dashboard.Admin.register(Networks) diff --git a/horizon/dashboards/nova/containers/__init__.py b/horizon/dashboards/admin/networks/ports/__init__.py similarity index 100% rename from horizon/dashboards/nova/containers/__init__.py rename to horizon/dashboards/admin/networks/ports/__init__.py diff --git a/horizon/dashboards/syspanel/networks/ports/forms.py b/horizon/dashboards/admin/networks/ports/forms.py similarity index 96% rename from horizon/dashboards/syspanel/networks/ports/forms.py rename to horizon/dashboards/admin/networks/ports/forms.py index 2e86ed137..203ae2c4d 100644 --- a/horizon/dashboards/syspanel/networks/ports/forms.py +++ b/horizon/dashboards/admin/networks/ports/forms.py @@ -58,7 +58,7 @@ class CreatePort(forms.SelfHandlingForm): msg = _('Failed to create a port for network %s') \ % data['network_id'] LOG.info(msg) - redirect = reverse('horizon:syspanel:networks:detail', + redirect = reverse('horizon:admin:networks:detail', args=(data['network_id'],)) exceptions.handle(request, msg, redirect=redirect) @@ -87,6 +87,6 @@ class UpdatePort(forms.SelfHandlingForm): except Exception: msg = _('Failed to update port %s') % data['port_id'] LOG.info(msg) - redirect = reverse('horizon:syspanel:networks:detail', + redirect = reverse('horizon:admin:networks:detail', args=[data['network_id']]) exceptions.handle(request, msg, redirect=redirect) diff --git a/horizon/dashboards/syspanel/networks/ports/tables.py b/horizon/dashboards/admin/networks/ports/tables.py similarity index 89% rename from horizon/dashboards/syspanel/networks/ports/tables.py rename to horizon/dashboards/admin/networks/ports/tables.py index 824d6703c..aa7aa7464 100644 --- a/horizon/dashboards/syspanel/networks/ports/tables.py +++ b/horizon/dashboards/admin/networks/ports/tables.py @@ -23,7 +23,7 @@ from horizon import api from horizon import exceptions from horizon import tables -from horizon.dashboards.nova.networks.ports.tables import (get_fixed_ips, +from horizon.dashboards.project.networks.ports.tables import (get_fixed_ips, get_attached) @@ -41,7 +41,7 @@ class DeletePort(tables.DeleteAction): msg = _('Failed to delete subnet %s') % obj_id LOG.info(msg) network_id = self.table.kwargs['network_id'] - redirect = reverse('horizon:syspanel:networks:detail', + redirect = reverse('horizon:admin:networks:detail', args=[network_id]) exceptions.handle(request, msg, redirect=redirect) @@ -49,7 +49,7 @@ class DeletePort(tables.DeleteAction): class CreatePort(tables.LinkAction): name = "create" verbose_name = _("Create Port") - url = "horizon:syspanel:networks:addport" + url = "horizon:admin:networks:addport" classes = ("ajax-modal", "btn-create") def get_link_url(self, datum=None): @@ -60,7 +60,7 @@ class CreatePort(tables.LinkAction): class UpdatePort(tables.LinkAction): name = "update" verbose_name = _("Edit Port") - url = "horizon:syspanel:networks:editport" + url = "horizon:admin:networks:editport" classes = ("ajax-modal", "btn-edit") def get_link_url(self, port): @@ -71,7 +71,7 @@ class UpdatePort(tables.LinkAction): class PortsTable(tables.DataTable): name = tables.Column("name", verbose_name=_("Name"), - link="horizon:syspanel:networks:ports:detail") + link="horizon:admin:networks:ports:detail") fixed_ips = tables.Column(get_fixed_ips, verbose_name=_("Fixed IPs")) device_id = tables.Column(get_attached, verbose_name=_("Device Attached")) status = tables.Column("status", verbose_name=_("Status")) diff --git a/horizon/dashboards/syspanel/networks/ports/tabs.py b/horizon/dashboards/admin/networks/ports/tabs.py similarity index 91% rename from horizon/dashboards/syspanel/networks/ports/tabs.py rename to horizon/dashboards/admin/networks/ports/tabs.py index a1f723e09..f3b15d2ea 100644 --- a/horizon/dashboards/syspanel/networks/ports/tabs.py +++ b/horizon/dashboards/admin/networks/ports/tabs.py @@ -28,14 +28,14 @@ LOG = logging.getLogger(__name__) class OverviewTab(tabs.Tab): name = _("Overview") slug = "overview" - template_name = "nova/networks/ports/_detail_overview.html" + template_name = "project/networks/ports/_detail_overview.html" def get_context_data(self, request): port_id = self.tab_group.kwargs['port_id'] try: port = api.quantum.port_get(self.request, port_id) except: - redirect = reverse('horizon:syspanel:networks:index') + redirect = reverse('horizon:admin:networks:index') msg = _('Unable to retrieve port details.') exceptions.handle(request, msg, redirect=redirect) return {'port': port} diff --git a/horizon/dashboards/syspanel/networks/ports/urls.py b/horizon/dashboards/admin/networks/ports/urls.py similarity index 84% rename from horizon/dashboards/syspanel/networks/ports/urls.py rename to horizon/dashboards/admin/networks/ports/urls.py index 5bac3a03d..eb6d5c9b9 100644 --- a/horizon/dashboards/syspanel/networks/ports/urls.py +++ b/horizon/dashboards/admin/networks/ports/urls.py @@ -16,9 +16,9 @@ from django.conf.urls.defaults import patterns, url -from horizon.dashboards.nova.networks.ports.views import DetailView +from horizon.dashboards.project.networks.ports.views import DetailView PORTS = r'^(?P[^/]+)/%s$' -urlpatterns = patterns('horizon.dashboards.syspanel.networks.ports.views', +urlpatterns = patterns('horizon.dashboards.admin.networks.ports.views', url(PORTS % 'detail', DetailView.as_view(), name='detail')) diff --git a/horizon/dashboards/syspanel/networks/ports/views.py b/horizon/dashboards/admin/networks/ports/views.py similarity index 89% rename from horizon/dashboards/syspanel/networks/ports/views.py rename to horizon/dashboards/admin/networks/ports/views.py index 9ac57de61..9ccfb708e 100644 --- a/horizon/dashboards/syspanel/networks/ports/views.py +++ b/horizon/dashboards/admin/networks/ports/views.py @@ -29,8 +29,8 @@ LOG = logging.getLogger(__name__) class CreateView(forms.ModalFormView): form_class = CreatePort - template_name = 'syspanel/networks/ports/create.html' - success_url = 'horizon:syspanel:networks:detail' + template_name = 'admin/networks/ports/create.html' + success_url = 'horizon:admin:networks:detail' def get_success_url(self): return reverse(self.success_url, @@ -43,7 +43,7 @@ class CreateView(forms.ModalFormView): self._object = api.quantum.network_get(self.request, network_id) except: - redirect = reverse("horizon:syspanel:networks:detail", + redirect = reverse("horizon:admin:networks:detail", args=(self.kwargs['network_id'],)) msg = _("Unable to retrieve network.") exceptions.handle(self.request, msg, redirect=redirect) @@ -62,9 +62,9 @@ class CreateView(forms.ModalFormView): class UpdateView(forms.ModalFormView): form_class = UpdatePort - template_name = 'syspanel/networks/ports/update.html' + template_name = 'admin/networks/ports/update.html' context_object_name = 'port' - success_url = 'horizon:syspanel:networks:detail' + success_url = 'horizon:admin:networks:detail' def get_success_url(self): return reverse(self.success_url, @@ -76,7 +76,7 @@ class UpdateView(forms.ModalFormView): try: self._object = api.quantum.port_get(self.request, port_id) except: - redirect = reverse("horizon:syspanel:networks:detail", + redirect = reverse("horizon:admin:networks:detail", args=(self.kwargs['network_id'],)) msg = _('Unable to retrieve port details') exceptions.handle(self.request, msg, redirect=redirect) diff --git a/horizon/dashboards/nova/images_and_snapshots/__init__.py b/horizon/dashboards/admin/networks/subnets/__init__.py similarity index 100% rename from horizon/dashboards/nova/images_and_snapshots/__init__.py rename to horizon/dashboards/admin/networks/subnets/__init__.py diff --git a/horizon/dashboards/syspanel/networks/subnets/forms.py b/horizon/dashboards/admin/networks/subnets/forms.py similarity index 90% rename from horizon/dashboards/syspanel/networks/subnets/forms.py rename to horizon/dashboards/admin/networks/subnets/forms.py index 9727831e9..97fe83290 100644 --- a/horizon/dashboards/syspanel/networks/subnets/forms.py +++ b/horizon/dashboards/admin/networks/subnets/forms.py @@ -23,14 +23,14 @@ from horizon import api from horizon import forms from horizon import exceptions -from horizon.dashboards.nova.networks.subnets import forms as user_forms +from horizon.dashboards.project.networks.subnets import forms as user_forms LOG = logging.getLogger(__name__) class CreateSubnet(user_forms.CreateSubnet): - failure_url = 'horizon:syspanel:networks:detail' + failure_url = 'horizon:admin:networks:detail' def handle(self, request, data): try: @@ -49,4 +49,4 @@ class CreateSubnet(user_forms.CreateSubnet): class UpdateSubnet(user_forms.UpdateSubnet): tenant_id = forms.CharField(widget=forms.HiddenInput()) - failure_url = 'horizon:syspanel:networks:detail' + failure_url = 'horizon:admin:networks:detail' diff --git a/horizon/dashboards/syspanel/networks/subnets/tables.py b/horizon/dashboards/admin/networks/subnets/tables.py similarity index 91% rename from horizon/dashboards/syspanel/networks/subnets/tables.py rename to horizon/dashboards/admin/networks/subnets/tables.py index 20c740141..aeeedd397 100644 --- a/horizon/dashboards/syspanel/networks/subnets/tables.py +++ b/horizon/dashboards/admin/networks/subnets/tables.py @@ -38,7 +38,7 @@ class DeleteSubnet(tables.DeleteAction): msg = _('Failed to delete subnet %s') % obj_id LOG.info(msg) network_id = self.table.kwargs['network_id'] - redirect = reverse('horizon:syspanel:networks:detail', + redirect = reverse('horizon:admin:networks:detail', args=[network_id]) exceptions.handle(request, msg, redirect=redirect) @@ -46,7 +46,7 @@ class DeleteSubnet(tables.DeleteAction): class CreateSubnet(tables.LinkAction): name = "create" verbose_name = _("Create Subnet") - url = "horizon:syspanel:networks:addsubnet" + url = "horizon:admin:networks:addsubnet" classes = ("ajax-modal", "btn-create") def get_link_url(self, datum=None): @@ -57,7 +57,7 @@ class CreateSubnet(tables.LinkAction): class UpdateSubnet(tables.LinkAction): name = "update" verbose_name = _("Edit Subnet") - url = "horizon:syspanel:networks:editsubnet" + url = "horizon:admin:networks:editsubnet" classes = ("ajax-modal", "btn-edit") def get_link_url(self, subnet): @@ -67,7 +67,7 @@ class UpdateSubnet(tables.LinkAction): class SubnetsTable(tables.DataTable): name = tables.Column("name", verbose_name=_("Name"), - link='horizon:syspanel:networks:subnets:detail') + link='horizon:admin:networks:subnets:detail') cidr = tables.Column("cidr", verbose_name=_("CIDR")) ip_version = tables.Column("ipver_str", verbose_name=_("IP Version")) gateway_ip = tables.Column("gateway_ip", verbose_name=_("Gateway IP")) diff --git a/horizon/dashboards/syspanel/networks/subnets/urls.py b/horizon/dashboards/admin/networks/subnets/urls.py similarity index 84% rename from horizon/dashboards/syspanel/networks/subnets/urls.py rename to horizon/dashboards/admin/networks/subnets/urls.py index 7017e8f1b..c46df39c0 100644 --- a/horizon/dashboards/syspanel/networks/subnets/urls.py +++ b/horizon/dashboards/admin/networks/subnets/urls.py @@ -16,9 +16,9 @@ from django.conf.urls.defaults import patterns, url -from horizon.dashboards.nova.networks.subnets.views import DetailView +from horizon.dashboards.project.networks.subnets.views import DetailView SUBNETS = r'^(?P[^/]+)/%s$' -urlpatterns = patterns('horizon.dashboards.syspanel.networks.subnets.views', +urlpatterns = patterns('horizon.dashboards.admin.networks.subnets.views', url(SUBNETS % 'detail', DetailView.as_view(), name='detail')) diff --git a/horizon/dashboards/syspanel/networks/subnets/views.py b/horizon/dashboards/admin/networks/subnets/views.py similarity index 90% rename from horizon/dashboards/syspanel/networks/subnets/views.py rename to horizon/dashboards/admin/networks/subnets/views.py index 0c5a0c1ed..6066ba482 100644 --- a/horizon/dashboards/syspanel/networks/subnets/views.py +++ b/horizon/dashboards/admin/networks/subnets/views.py @@ -29,8 +29,8 @@ LOG = logging.getLogger(__name__) class CreateView(forms.ModalFormView): form_class = CreateSubnet - template_name = 'syspanel/networks/subnets/create.html' - success_url = 'horizon:syspanel:networks:detail' + template_name = 'admin/networks/subnets/create.html' + success_url = 'horizon:admin:networks:detail' def get_success_url(self): return reverse(self.success_url, @@ -43,7 +43,7 @@ class CreateView(forms.ModalFormView): self._object = api.quantum.network_get(self.request, network_id) except: - redirect = reverse('horizon:nova:networks:index') + redirect = reverse('horizon:project:networks:index') msg = _("Unable to retrieve network.") exceptions.handle(self.request, msg, redirect=redirect) return self._object @@ -61,9 +61,9 @@ class CreateView(forms.ModalFormView): class UpdateView(forms.ModalFormView): form_class = UpdateSubnet - template_name = 'syspanel/networks/subnets/update.html' + template_name = 'admin/networks/subnets/update.html' context_object_name = 'subnet' - success_url = 'horizon:syspanel:networks:detail' + success_url = 'horizon:admin:networks:detail' def get_success_url(self): return reverse(self.success_url, @@ -75,7 +75,7 @@ class UpdateView(forms.ModalFormView): try: self._object = api.quantum.subnet_get(self.request, subnet_id) except: - redirect = reverse("horizon:syspanel:networks:detail", + redirect = reverse("horizon:admin:networks:detail", args=(self.kwargs['network_id'],)) msg = _('Unable to retrieve subnet details') exceptions.handle(self.request, msg, redirect=redirect) diff --git a/horizon/dashboards/syspanel/networks/tables.py b/horizon/dashboards/admin/networks/tables.py similarity index 89% rename from horizon/dashboards/syspanel/networks/tables.py rename to horizon/dashboards/admin/networks/tables.py index 6d1ae5f80..e57603b2a 100644 --- a/horizon/dashboards/syspanel/networks/tables.py +++ b/horizon/dashboards/admin/networks/tables.py @@ -24,7 +24,7 @@ from horizon import api from horizon import exceptions from horizon import tables -from horizon.dashboards.nova.networks.tables import get_subnets +from horizon.dashboards.project.networks.tables import get_subnets LOG = logging.getLogger(__name__) @@ -40,21 +40,21 @@ class DeleteNetwork(tables.DeleteAction): except: msg = _('Failed to delete network %s') % obj_id LOG.info(msg) - redirect = reverse('horizon:syspanel:networks:index') + redirect = reverse('horizon:admin:networks:index') exceptions.handle(request, msg, redirect=redirect) class CreateNetwork(tables.LinkAction): name = "create" verbose_name = _("Create Network") - url = "horizon:syspanel:networks:create" + url = "horizon:admin:networks:create" classes = ("ajax-modal", "btn-create") class EditNetwork(tables.LinkAction): name = "update" verbose_name = _("Edit Network") - url = "horizon:syspanel:networks:update" + url = "horizon:admin:networks:update" classes = ("ajax-modal", "btn-edit") @@ -66,7 +66,7 @@ class EditNetwork(tables.LinkAction): class NetworksTable(tables.DataTable): tenant = tables.Column("tenant_name", verbose_name=_("Project")) name = tables.Column("name", verbose_name=_("Network Name"), - link='horizon:syspanel:networks:detail') + link='horizon:admin:networks:detail') subnets = tables.Column(get_subnets, verbose_name=_("Subnets Associated"),) shared = tables.Column("shared", verbose_name=_("Shared"), diff --git a/horizon/dashboards/syspanel/networks/templates/networks/_create.html b/horizon/dashboards/admin/networks/templates/networks/_create.html similarity index 77% rename from horizon/dashboards/syspanel/networks/templates/networks/_create.html rename to horizon/dashboards/admin/networks/templates/networks/_create.html index 7b35a3213..6fda0ca63 100644 --- a/horizon/dashboards/syspanel/networks/templates/networks/_create.html +++ b/horizon/dashboards/admin/networks/templates/networks/_create.html @@ -2,7 +2,7 @@ {% load i18n %} {% block form_id %}create_network_form{% endblock %} -{% block form_action %}{% url horizon:syspanel:networks:create %}{% endblock %} +{% block form_action %}{% url horizon:admin:networks:create %}{% endblock %} {% block modal_id %}create_network_modal{% endblock %} {% block modal-header %}{% trans "Create Network" %}{% endblock %} @@ -21,5 +21,5 @@ {% block modal-footer %} - {% trans "Cancel" %} + {% trans "Cancel" %} {% endblock %} diff --git a/horizon/dashboards/nova/networks/templates/networks/_update.html b/horizon/dashboards/admin/networks/templates/networks/_update.html similarity index 75% rename from horizon/dashboards/nova/networks/templates/networks/_update.html rename to horizon/dashboards/admin/networks/templates/networks/_update.html index 50413cfe0..7ad0c69c3 100644 --- a/horizon/dashboards/nova/networks/templates/networks/_update.html +++ b/horizon/dashboards/admin/networks/templates/networks/_update.html @@ -2,7 +2,7 @@ {% load i18n %} {% block form_id %}update_network_form{% endblock %} -{% block form_action %}{% url horizon:nova:networks:update network_id %}{% endblock %} +{% block form_action %}{% url horizon:admin:networks:update network_id %}{% endblock %} {% block modal-header %}{% trans "Edit Network" %}{% endblock %} @@ -20,5 +20,5 @@ {% block modal-footer %} - {% trans "Cancel" %} + {% trans "Cancel" %} {% endblock %} diff --git a/horizon/dashboards/syspanel/networks/templates/networks/create.html b/horizon/dashboards/admin/networks/templates/networks/create.html similarity index 84% rename from horizon/dashboards/syspanel/networks/templates/networks/create.html rename to horizon/dashboards/admin/networks/templates/networks/create.html index c39cc0859..975227f4e 100644 --- a/horizon/dashboards/syspanel/networks/templates/networks/create.html +++ b/horizon/dashboards/admin/networks/templates/networks/create.html @@ -7,5 +7,5 @@ {% endblock page_header %} {% block main %} - {% include "syspanel/networks/_create.html" %} + {% include "admin/networks/_create.html" %} {% endblock %} diff --git a/horizon/dashboards/syspanel/networks/templates/networks/index.html b/horizon/dashboards/admin/networks/templates/networks/index.html similarity index 100% rename from horizon/dashboards/syspanel/networks/templates/networks/index.html rename to horizon/dashboards/admin/networks/templates/networks/index.html diff --git a/horizon/dashboards/syspanel/networks/templates/networks/ports/_create.html b/horizon/dashboards/admin/networks/templates/networks/ports/_create.html similarity index 77% rename from horizon/dashboards/syspanel/networks/templates/networks/ports/_create.html rename to horizon/dashboards/admin/networks/templates/networks/ports/_create.html index ff6549363..a35266149 100644 --- a/horizon/dashboards/syspanel/networks/templates/networks/ports/_create.html +++ b/horizon/dashboards/admin/networks/templates/networks/ports/_create.html @@ -2,7 +2,7 @@ {% load i18n %} {% block form_id %}create_port_form{% endblock %} -{% block form_action %}{% url horizon:syspanel:networks:addport network.id %} +{% block form_action %}{% url horizon:admin:networks:addport network.id %} {% endblock %} {% block modal-header %}{% trans "Create Port" %}{% endblock %} @@ -21,5 +21,5 @@ {% block modal-footer %} - {% trans "Cancel" %} + {% trans "Cancel" %} {% endblock %} diff --git a/horizon/dashboards/syspanel/networks/templates/networks/ports/_update.html b/horizon/dashboards/admin/networks/templates/networks/ports/_update.html similarity index 75% rename from horizon/dashboards/syspanel/networks/templates/networks/ports/_update.html rename to horizon/dashboards/admin/networks/templates/networks/ports/_update.html index 6481c2a69..bb3162817 100644 --- a/horizon/dashboards/syspanel/networks/templates/networks/ports/_update.html +++ b/horizon/dashboards/admin/networks/templates/networks/ports/_update.html @@ -2,7 +2,7 @@ {% load i18n %} {% block form_id %}update_port_form{% endblock %} -{% block form_action %}{% url horizon:syspanel:networks:editport network_id port_id %}{% endblock %} +{% block form_action %}{% url horizon:admin:networks:editport network_id port_id %}{% endblock %} {% block modal-header %}{% trans "Edit Port" %}{% endblock %} @@ -25,5 +25,5 @@ {% block modal-footer %} - {% trans "Cancel" %} + {% trans "Cancel" %} {% endblock %} diff --git a/horizon/dashboards/syspanel/networks/templates/networks/ports/create.html b/horizon/dashboards/admin/networks/templates/networks/ports/create.html similarity index 82% rename from horizon/dashboards/syspanel/networks/templates/networks/ports/create.html rename to horizon/dashboards/admin/networks/templates/networks/ports/create.html index 76f1019c5..e99551300 100644 --- a/horizon/dashboards/syspanel/networks/templates/networks/ports/create.html +++ b/horizon/dashboards/admin/networks/templates/networks/ports/create.html @@ -7,5 +7,5 @@ {% endblock page_header %} {% block main %} - {% include "syspanel/networks/ports/_create.html" %} + {% include "admin/networks/ports/_create.html" %} {% endblock %} diff --git a/horizon/dashboards/syspanel/networks/templates/networks/ports/update.html b/horizon/dashboards/admin/networks/templates/networks/ports/update.html similarity index 82% rename from horizon/dashboards/syspanel/networks/templates/networks/ports/update.html rename to horizon/dashboards/admin/networks/templates/networks/ports/update.html index 33b64d89a..ae0f91cfa 100644 --- a/horizon/dashboards/syspanel/networks/templates/networks/ports/update.html +++ b/horizon/dashboards/admin/networks/templates/networks/ports/update.html @@ -7,5 +7,5 @@ {% endblock page_header %} {% block main %} - {% include 'syspanel/networks/ports/_update.html' %} + {% include 'admin/networks/ports/_update.html' %} {% endblock %} diff --git a/horizon/dashboards/syspanel/networks/templates/networks/subnets/_create.html b/horizon/dashboards/admin/networks/templates/networks/subnets/_create.html similarity index 78% rename from horizon/dashboards/syspanel/networks/templates/networks/subnets/_create.html rename to horizon/dashboards/admin/networks/templates/networks/subnets/_create.html index 1e16b900f..c7367b4c8 100644 --- a/horizon/dashboards/syspanel/networks/templates/networks/subnets/_create.html +++ b/horizon/dashboards/admin/networks/templates/networks/subnets/_create.html @@ -2,7 +2,7 @@ {% load i18n %} {% block form_id %}create_subnet_form{% endblock %} -{% block form_action %}{% url horizon:syspanel:networks:addsubnet network.id %} +{% block form_action %}{% url horizon:admin:networks:addsubnet network.id %} {% endblock %} {% block modal-header %}{% trans "Create Subnet" %}{% endblock %} @@ -21,5 +21,5 @@ {% block modal-footer %} - {% trans "Cancel" %} + {% trans "Cancel" %} {% endblock %} diff --git a/horizon/dashboards/syspanel/networks/templates/networks/subnets/_update.html b/horizon/dashboards/admin/networks/templates/networks/subnets/_update.html similarity index 78% rename from horizon/dashboards/syspanel/networks/templates/networks/subnets/_update.html rename to horizon/dashboards/admin/networks/templates/networks/subnets/_update.html index e7a41af7f..45a125ea6 100644 --- a/horizon/dashboards/syspanel/networks/templates/networks/subnets/_update.html +++ b/horizon/dashboards/admin/networks/templates/networks/subnets/_update.html @@ -2,7 +2,7 @@ {% load i18n %} {% block form_id %}update_subnet_form{% endblock %} -{% block form_action %}{% url horizon:syspanel:networks:editsubnet network_id subnet_id %}{% endblock %} +{% block form_action %}{% url horizon:admin:networks:editsubnet network_id subnet_id %}{% endblock %} {% block modal-header %}{% trans "Edit Subnet" %}{% endblock %} @@ -29,5 +29,5 @@ {% block modal-footer %} - {% trans "Cancel" %} + {% trans "Cancel" %} {% endblock %} diff --git a/horizon/dashboards/nova/networks/templates/networks/subnets/create.html b/horizon/dashboards/admin/networks/templates/networks/subnets/create.html similarity index 83% rename from horizon/dashboards/nova/networks/templates/networks/subnets/create.html rename to horizon/dashboards/admin/networks/templates/networks/subnets/create.html index 01e052c2e..84624cc13 100644 --- a/horizon/dashboards/nova/networks/templates/networks/subnets/create.html +++ b/horizon/dashboards/admin/networks/templates/networks/subnets/create.html @@ -7,5 +7,5 @@ {% endblock page_header %} {% block main %} - {% include "nova/networks/subnets/_create.html" %} + {% include "admin/networks/subnets/_create.html" %} {% endblock %} diff --git a/horizon/dashboards/syspanel/networks/templates/networks/subnets/index.html b/horizon/dashboards/admin/networks/templates/networks/subnets/index.html similarity index 100% rename from horizon/dashboards/syspanel/networks/templates/networks/subnets/index.html rename to horizon/dashboards/admin/networks/templates/networks/subnets/index.html diff --git a/horizon/dashboards/nova/networks/templates/networks/subnets/update.html b/horizon/dashboards/admin/networks/templates/networks/subnets/update.html similarity index 83% rename from horizon/dashboards/nova/networks/templates/networks/subnets/update.html rename to horizon/dashboards/admin/networks/templates/networks/subnets/update.html index d5b813728..b152cdf4e 100644 --- a/horizon/dashboards/nova/networks/templates/networks/subnets/update.html +++ b/horizon/dashboards/admin/networks/templates/networks/subnets/update.html @@ -7,5 +7,5 @@ {% endblock page_header %} {% block main %} - {% include 'nova/networks/subnets/_update.html' %} + {% include 'admin/networks/subnets/_update.html' %} {% endblock %} diff --git a/horizon/dashboards/nova/networks/templates/networks/update.html b/horizon/dashboards/admin/networks/templates/networks/update.html similarity index 85% rename from horizon/dashboards/nova/networks/templates/networks/update.html rename to horizon/dashboards/admin/networks/templates/networks/update.html index 599de61ac..a70a0b1a7 100644 --- a/horizon/dashboards/nova/networks/templates/networks/update.html +++ b/horizon/dashboards/admin/networks/templates/networks/update.html @@ -7,5 +7,5 @@ {% endblock page_header %} {% block main %} - {% include 'nova/networks/_update.html' %} + {% include 'admin/networks/_update.html' %} {% endblock %} diff --git a/horizon/dashboards/syspanel/networks/tests.py b/horizon/dashboards/admin/networks/tests.py similarity index 88% rename from horizon/dashboards/syspanel/networks/tests.py rename to horizon/dashboards/admin/networks/tests.py index ecc845af6..e62d735d2 100644 --- a/horizon/dashboards/syspanel/networks/tests.py +++ b/horizon/dashboards/admin/networks/tests.py @@ -23,7 +23,7 @@ from horizon import api from horizon import test -INDEX_URL = reverse('horizon:syspanel:networks:index') +INDEX_URL = reverse('horizon:admin:networks:index') class NetworkTests(test.BaseAdminViewTests): @@ -40,7 +40,7 @@ class NetworkTests(test.BaseAdminViewTests): res = self.client.get(INDEX_URL) - self.assertTemplateUsed(res, 'syspanel/networks/index.html') + self.assertTemplateUsed(res, 'admin/networks/index.html') networks = res.context['networks_table'].data self.assertItemsEqual(networks, self.networks.list()) @@ -53,7 +53,7 @@ class NetworkTests(test.BaseAdminViewTests): res = self.client.get(INDEX_URL) - self.assertTemplateUsed(res, 'syspanel/networks/index.html') + self.assertTemplateUsed(res, 'admin/networks/index.html') self.assertEqual(len(res.context['networks_table'].data), 0) self.assertMessageCount(res, error=1) @@ -71,10 +71,10 @@ class NetworkTests(test.BaseAdminViewTests): self.mox.ReplayAll() - res = self.client.get(reverse('horizon:syspanel:networks:detail', + res = self.client.get(reverse('horizon:admin:networks:detail', args=[network_id])) - self.assertTemplateUsed(res, 'nova/networks/detail.html') + self.assertTemplateUsed(res, 'project/networks/detail.html') subnets = res.context['subnets_table'].data ports = res.context['ports_table'].data self.assertItemsEqual(subnets, [self.subnets.first()]) @@ -94,7 +94,7 @@ class NetworkTests(test.BaseAdminViewTests): self.mox.ReplayAll() - url = reverse('horizon:syspanel:networks:detail', args=[network_id]) + url = reverse('horizon:admin:networks:detail', args=[network_id]) res = self.client.get(url) redir_url = INDEX_URL @@ -114,10 +114,10 @@ class NetworkTests(test.BaseAdminViewTests): self.mox.ReplayAll() - res = self.client.get(reverse('horizon:syspanel:networks:detail', + res = self.client.get(reverse('horizon:admin:networks:detail', args=[network_id])) - self.assertTemplateUsed(res, 'nova/networks/detail.html') + self.assertTemplateUsed(res, 'project/networks/detail.html') subnets = res.context['subnets_table'].data ports = res.context['ports_table'].data self.assertEqual(len(subnets), 0) @@ -137,10 +137,10 @@ class NetworkTests(test.BaseAdminViewTests): self.mox.ReplayAll() - res = self.client.get(reverse('horizon:syspanel:networks:detail', + res = self.client.get(reverse('horizon:admin:networks:detail', args=[network_id])) - self.assertTemplateUsed(res, 'nova/networks/detail.html') + self.assertTemplateUsed(res, 'project/networks/detail.html') subnets = res.context['subnets_table'].data ports = res.context['ports_table'].data self.assertItemsEqual(subnets, [self.subnets.first()]) @@ -153,10 +153,10 @@ class NetworkTests(test.BaseAdminViewTests): .AndReturn(tenants) self.mox.ReplayAll() - url = reverse('horizon:syspanel:networks:create') + url = reverse('horizon:admin:networks:create') res = self.client.get(url) - self.assertTemplateUsed(res, 'syspanel/networks/create.html') + self.assertTemplateUsed(res, 'admin/networks/create.html') @test.create_stubs({api.quantum: ('network_create',), api.keystone: ('tenant_list',)}) @@ -174,7 +174,7 @@ class NetworkTests(test.BaseAdminViewTests): form_data = {'tenant_id': tenant_id, 'name': network.name, 'shared': True} - url = reverse('horizon:syspanel:networks:create') + url = reverse('horizon:admin:networks:create') res = self.client.post(url, form_data) self.assertNoFormErrors(res) @@ -196,7 +196,7 @@ class NetworkTests(test.BaseAdminViewTests): form_data = {'tenant_id': tenant_id, 'name': network.name, 'shared': False} - url = reverse('horizon:syspanel:networks:create') + url = reverse('horizon:admin:networks:create') res = self.client.post(url, form_data) self.assertNoFormErrors(res) @@ -210,10 +210,10 @@ class NetworkTests(test.BaseAdminViewTests): self.mox.ReplayAll() - url = reverse('horizon:syspanel:networks:update', args=[network.id]) + url = reverse('horizon:admin:networks:update', args=[network.id]) res = self.client.get(url) - self.assertTemplateUsed(res, 'syspanel/networks/update.html') + self.assertTemplateUsed(res, 'admin/networks/update.html') @test.create_stubs({api.quantum: ('network_get',)}) def test_network_update_get_exception(self): @@ -223,7 +223,7 @@ class NetworkTests(test.BaseAdminViewTests): self.mox.ReplayAll() - url = reverse('horizon:syspanel:networks:update', args=[network.id]) + url = reverse('horizon:admin:networks:update', args=[network.id]) res = self.client.get(url) redir_url = INDEX_URL @@ -244,7 +244,7 @@ class NetworkTests(test.BaseAdminViewTests): 'name': network.name, 'tenant_id': network.tenant_id, 'shared': True} - url = reverse('horizon:syspanel:networks:update', args=[network.id]) + url = reverse('horizon:admin:networks:update', args=[network.id]) res = self.client.post(url, formData) self.assertRedirectsNoFollow(res, INDEX_URL) @@ -264,7 +264,7 @@ class NetworkTests(test.BaseAdminViewTests): 'name': network.name, 'tenant_id': network.tenant_id, 'shared': False} - url = reverse('horizon:syspanel:networks:update', args=[network.id]) + url = reverse('horizon:admin:networks:update', args=[network.id]) res = self.client.post(url, form_data) self.assertRedirectsNoFollow(res, INDEX_URL) @@ -316,11 +316,11 @@ class NetworkTests(test.BaseAdminViewTests): self.mox.ReplayAll() - url = reverse('horizon:syspanel:networks:subnets:detail', + url = reverse('horizon:admin:networks:subnets:detail', args=[subnet.id]) res = self.client.get(url) - self.assertTemplateUsed(res, 'nova/networks/subnets/detail.html') + self.assertTemplateUsed(res, 'project/networks/subnets/detail.html') self.assertEqual(res.context['subnet'].id, subnet.id) @test.create_stubs({api.quantum: ('subnet_get',)}) @@ -331,13 +331,13 @@ class NetworkTests(test.BaseAdminViewTests): self.mox.ReplayAll() - url = reverse('horizon:syspanel:networks:subnets:detail', + url = reverse('horizon:admin:networks:subnets:detail', args=[subnet.id]) res = self.client.get(url) - # syspanel DetailView is shared with userpanel one, so + # admin DetailView is shared with userpanel one, so # redirection URL on error is userpanel index. - redir_url = reverse('horizon:nova:networks:index') + redir_url = reverse('horizon:project:networks:index') self.assertRedirectsNoFollow(res, redir_url) @test.create_stubs({api.quantum: ('network_get',)}) @@ -348,11 +348,11 @@ class NetworkTests(test.BaseAdminViewTests): .AndReturn(self.networks.first()) self.mox.ReplayAll() - url = reverse('horizon:syspanel:networks:addsubnet', + url = reverse('horizon:admin:networks:addsubnet', args=[network.id]) res = self.client.get(url) - self.assertTemplateUsed(res, 'syspanel/networks/subnets/create.html') + self.assertTemplateUsed(res, 'admin/networks/subnets/create.html') @test.create_stubs({api.quantum: ('network_get', 'subnet_create',)}) @@ -382,12 +382,12 @@ class NetworkTests(test.BaseAdminViewTests): 'cidr': subnet.cidr, 'ip_version': subnet.ip_version, 'gateway_ip': subnet.gateway_ip} - url = reverse('horizon:syspanel:networks:addsubnet', + url = reverse('horizon:admin:networks:addsubnet', args=[subnet.network_id]) res = self.client.post(url, form_data) self.assertNoFormErrors(res) - redir_url = reverse('horizon:syspanel:networks:detail', + redir_url = reverse('horizon:admin:networks:detail', args=[subnet.network_id]) self.assertRedirectsNoFollow(res, redir_url) @@ -407,14 +407,14 @@ class NetworkTests(test.BaseAdminViewTests): 'cidr': subnet.cidr, 'ip_version': subnet.ip_version, 'gateway_ip': subnet.gateway_ip} - url = reverse('horizon:syspanel:networks:addsubnet', + url = reverse('horizon:admin:networks:addsubnet', args=[subnet.network_id]) res = self.client.post(url, form_data) self.assertNoFormErrors(res) - # syspanel DetailView is shared with userpanel one, so + # admin DetailView is shared with userpanel one, so # redirection URL on error is userpanel index. - redir_url = reverse('horizon:nova:networks:index') + redir_url = reverse('horizon:project:networks:index') self.assertRedirectsNoFollow(res, redir_url) @test.create_stubs({api.quantum: ('network_get', @@ -445,11 +445,11 @@ class NetworkTests(test.BaseAdminViewTests): 'cidr': subnet.cidr, 'ip_version': subnet.ip_version, 'gateway_ip': subnet.gateway_ip} - url = reverse('horizon:syspanel:networks:addsubnet', + url = reverse('horizon:admin:networks:addsubnet', args=[subnet.network_id]) res = self.client.post(url, form_data) - redir_url = reverse('horizon:syspanel:networks:detail', + redir_url = reverse('horizon:admin:networks:detail', args=[subnet.network_id]) self.assertRedirectsNoFollow(res, redir_url) @@ -470,7 +470,7 @@ class NetworkTests(test.BaseAdminViewTests): 'cidr': cidr, 'ip_version': subnet.ip_version, 'gateway_ip': subnet.gateway_ip} - url = reverse('horizon:syspanel:networks:addsubnet', + url = reverse('horizon:admin:networks:addsubnet', args=[subnet.network_id]) res = self.client.post(url, form_data) @@ -494,7 +494,7 @@ class NetworkTests(test.BaseAdminViewTests): 'cidr': subnet.cidr, 'ip_version': subnet.ip_version, 'gateway_ip': gateway_ip} - url = reverse('horizon:syspanel:networks:addsubnet', + url = reverse('horizon:admin:networks:addsubnet', args=[subnet.network_id]) res = self.client.post(url, form_data) @@ -519,11 +519,11 @@ class NetworkTests(test.BaseAdminViewTests): 'cidr': subnet.cidr, 'ip_version': subnet.ip_version, 'gateway_ip': subnet.gateway_ip} - url = reverse('horizon:syspanel:networks:editsubnet', + url = reverse('horizon:admin:networks:editsubnet', args=[subnet.network_id, subnet.id]) res = self.client.post(url, formData) - redir_url = reverse('horizon:syspanel:networks:detail', + redir_url = reverse('horizon:admin:networks:detail', args=[subnet.network_id]) self.assertRedirectsNoFollow(res, redir_url) @@ -544,7 +544,7 @@ class NetworkTests(test.BaseAdminViewTests): 'cidr': subnet.cidr, 'ip_version': subnet.ip_version, 'gateway_ip': gateway_ip} - url = reverse('horizon:syspanel:networks:editsubnet', + url = reverse('horizon:admin:networks:editsubnet', args=[subnet.network_id, subnet.id]) res = self.client.post(url, formData) @@ -564,7 +564,7 @@ class NetworkTests(test.BaseAdminViewTests): self.mox.ReplayAll() formData = {'action': 'subnets__delete__%s' % subnet.id} - url = reverse('horizon:syspanel:networks:detail', + url = reverse('horizon:admin:networks:detail', args=[network_id]) res = self.client.post(url, formData) @@ -585,7 +585,7 @@ class NetworkTests(test.BaseAdminViewTests): self.mox.ReplayAll() formData = {'action': 'subnets__delete__%s' % subnet.id} - url = reverse('horizon:syspanel:networks:detail', + url = reverse('horizon:admin:networks:detail', args=[network_id]) res = self.client.post(url, formData) @@ -599,10 +599,10 @@ class NetworkTests(test.BaseAdminViewTests): self.mox.ReplayAll() - res = self.client.get(reverse('horizon:syspanel:networks:ports:detail', + res = self.client.get(reverse('horizon:admin:networks:ports:detail', args=[port.id])) - self.assertTemplateUsed(res, 'nova/networks/ports/detail.html') + self.assertTemplateUsed(res, 'project/networks/ports/detail.html') self.assertEqual(res.context['port'].id, port.id) @test.create_stubs({api.quantum: ('port_get',)}) @@ -613,12 +613,12 @@ class NetworkTests(test.BaseAdminViewTests): self.mox.ReplayAll() - res = self.client.get(reverse('horizon:syspanel:networks:ports:detail', + res = self.client.get(reverse('horizon:admin:networks:ports:detail', args=[port.id])) - # syspanel DetailView is shared with userpanel one, so + # admin DetailView is shared with userpanel one, so # redirection URL on error is userpanel index. - redir_url = reverse('horizon:nova:networks:index') + redir_url = reverse('horizon:project:networks:index') self.assertRedirectsNoFollow(res, redir_url) @test.create_stubs({api.quantum: ('network_get',)}) @@ -629,11 +629,11 @@ class NetworkTests(test.BaseAdminViewTests): .AndReturn(self.networks.first()) self.mox.ReplayAll() - url = reverse('horizon:syspanel:networks:addport', + url = reverse('horizon:admin:networks:addport', args=[network.id]) res = self.client.get(url) - self.assertTemplateUsed(res, 'syspanel/networks/ports/create.html') + self.assertTemplateUsed(res, 'admin/networks/ports/create.html') @test.create_stubs({api.quantum: ('network_get', 'port_create')}) @@ -659,12 +659,12 @@ class NetworkTests(test.BaseAdminViewTests): 'network_name': network.name, 'name': port.name, 'device_id': port.device_id} - url = reverse('horizon:syspanel:networks:addport', + url = reverse('horizon:admin:networks:addport', args=[port.network_id]) res = self.client.post(url, form_data) self.assertNoFormErrors(res) - redir_url = reverse('horizon:syspanel:networks:detail', + redir_url = reverse('horizon:admin:networks:detail', args=[port.network_id]) self.assertRedirectsNoFollow(res, redir_url) @@ -692,12 +692,12 @@ class NetworkTests(test.BaseAdminViewTests): 'network_name': network.name, 'name': port.name, 'device_id': port.device_id} - url = reverse('horizon:syspanel:networks:addport', + url = reverse('horizon:admin:networks:addport', args=[port.network_id]) res = self.client.post(url, form_data) self.assertNoFormErrors(res) - redir_url = reverse('horizon:syspanel:networks:detail', + redir_url = reverse('horizon:admin:networks:detail', args=[port.network_id]) self.assertRedirectsNoFollow(res, redir_url) @@ -709,11 +709,11 @@ class NetworkTests(test.BaseAdminViewTests): .AndReturn(port) self.mox.ReplayAll() - url = reverse('horizon:syspanel:networks:editport', + url = reverse('horizon:admin:networks:editport', args=[port.network_id, port.id]) res = self.client.get(url) - self.assertTemplateUsed(res, 'syspanel/networks/ports/update.html') + self.assertTemplateUsed(res, 'admin/networks/ports/update.html') @test.create_stubs({api.quantum: ('port_get', 'port_modify')}) @@ -731,11 +731,11 @@ class NetworkTests(test.BaseAdminViewTests): 'port_id': port.id, 'name': port.name, 'device_id': port.device_id} - url = reverse('horizon:syspanel:networks:editport', + url = reverse('horizon:admin:networks:editport', args=[port.network_id, port.id]) res = self.client.post(url, formData) - redir_url = reverse('horizon:syspanel:networks:detail', + redir_url = reverse('horizon:admin:networks:detail', args=[port.network_id]) self.assertRedirectsNoFollow(res, redir_url) @@ -755,11 +755,11 @@ class NetworkTests(test.BaseAdminViewTests): 'port_id': port.id, 'name': port.name, 'device_id': port.device_id} - url = reverse('horizon:syspanel:networks:editport', + url = reverse('horizon:admin:networks:editport', args=[port.network_id, port.id]) res = self.client.post(url, formData) - redir_url = reverse('horizon:syspanel:networks:detail', + redir_url = reverse('horizon:admin:networks:detail', args=[port.network_id]) self.assertRedirectsNoFollow(res, redir_url) @@ -777,7 +777,7 @@ class NetworkTests(test.BaseAdminViewTests): self.mox.ReplayAll() formData = {'action': 'ports__delete__%s' % port.id} - url = reverse('horizon:syspanel:networks:detail', + url = reverse('horizon:admin:networks:detail', args=[network_id]) res = self.client.post(url, formData) @@ -798,7 +798,7 @@ class NetworkTests(test.BaseAdminViewTests): self.mox.ReplayAll() formData = {'action': 'ports__delete__%s' % port.id} - url = reverse('horizon:syspanel:networks:detail', + url = reverse('horizon:admin:networks:detail', args=[network_id]) res = self.client.post(url, formData) diff --git a/horizon/dashboards/syspanel/networks/urls.py b/horizon/dashboards/admin/networks/urls.py similarity index 100% rename from horizon/dashboards/syspanel/networks/urls.py rename to horizon/dashboards/admin/networks/urls.py diff --git a/horizon/dashboards/syspanel/networks/views.py b/horizon/dashboards/admin/networks/views.py similarity index 90% rename from horizon/dashboards/syspanel/networks/views.py rename to horizon/dashboards/admin/networks/views.py index b9cb335b1..3a5863472 100644 --- a/horizon/dashboards/syspanel/networks/views.py +++ b/horizon/dashboards/admin/networks/views.py @@ -30,14 +30,14 @@ from .subnets.tables import SubnetsTable from .ports.tables import PortsTable from .forms import CreateNetwork, UpdateNetwork -from horizon.dashboards.nova.networks import views as user_views +from horizon.dashboards.project.networks import views as user_views LOG = logging.getLogger(__name__) class IndexView(tables.DataTableView): table_class = NetworksTable - template_name = 'syspanel/networks/index.html' + template_name = 'admin/networks/index.html' def _get_tenant_list(self): if not hasattr(self, "_tenants"): @@ -72,14 +72,14 @@ class IndexView(tables.DataTableView): class CreateView(forms.ModalFormView): form_class = CreateNetwork - template_name = 'syspanel/networks/create.html' - success_url = reverse_lazy('horizon:syspanel:networks:index') + template_name = 'admin/networks/create.html' + success_url = reverse_lazy('horizon:admin:networks:index') class DetailView(tables.MultiTableView): table_classes = (SubnetsTable, PortsTable) - template_name = 'nova/networks/detail.html' - failure_url = reverse_lazy('horizon:syspanel:networks:index') + template_name = 'project/networks/detail.html' + failure_url = reverse_lazy('horizon:admin:networks:index') def get_subnets_data(self): try: @@ -129,8 +129,8 @@ class DetailView(tables.MultiTableView): class UpdateView(user_views.UpdateView): form_class = UpdateNetwork - template_name = 'syspanel/networks/update.html' - success_url = reverse_lazy('horizon:syspanel:networks:index') + template_name = 'admin/networks/update.html' + success_url = reverse_lazy('horizon:admin:networks:index') def get_initial(self): network = self._get_object() diff --git a/horizon/dashboards/nova/images_and_snapshots/images/__init__.py b/horizon/dashboards/admin/overview/__init__.py similarity index 100% rename from horizon/dashboards/nova/images_and_snapshots/images/__init__.py rename to horizon/dashboards/admin/overview/__init__.py diff --git a/horizon/dashboards/syspanel/overview/panel.py b/horizon/dashboards/admin/overview/panel.py similarity index 91% rename from horizon/dashboards/syspanel/overview/panel.py rename to horizon/dashboards/admin/overview/panel.py index 027841278..8ec061c63 100644 --- a/horizon/dashboards/syspanel/overview/panel.py +++ b/horizon/dashboards/admin/overview/panel.py @@ -21,7 +21,7 @@ from django.utils.translation import ugettext_lazy as _ import horizon -from horizon.dashboards.syspanel import dashboard +from horizon.dashboards.admin import dashboard class Overview(horizon.Panel): @@ -30,4 +30,4 @@ class Overview(horizon.Panel): permissions = ('openstack.roles.admin',) -dashboard.Syspanel.register(Overview) +dashboard.Admin.register(Overview) diff --git a/horizon/dashboards/syspanel/overview/templates/overview/usage.csv b/horizon/dashboards/admin/overview/templates/overview/usage.csv similarity index 100% rename from horizon/dashboards/syspanel/overview/templates/overview/usage.csv rename to horizon/dashboards/admin/overview/templates/overview/usage.csv diff --git a/horizon/dashboards/syspanel/overview/templates/overview/usage.html b/horizon/dashboards/admin/overview/templates/overview/usage.html similarity index 100% rename from horizon/dashboards/syspanel/overview/templates/overview/usage.html rename to horizon/dashboards/admin/overview/templates/overview/usage.html diff --git a/horizon/dashboards/syspanel/overview/tests.py b/horizon/dashboards/admin/overview/tests.py similarity index 92% rename from horizon/dashboards/syspanel/overview/tests.py rename to horizon/dashboards/admin/overview/tests.py index d41b729e3..2b112f2da 100644 --- a/horizon/dashboards/syspanel/overview/tests.py +++ b/horizon/dashboards/admin/overview/tests.py @@ -31,7 +31,7 @@ from horizon import usage from horizon.templatetags.sizeformat import mbformat -INDEX_URL = reverse('horizon:nova:overview:index') +INDEX_URL = reverse('horizon:project:overview:index') class UsageViewTests(test.BaseAdminViewTests): @@ -50,8 +50,8 @@ class UsageViewTests(test.BaseAdminViewTests): .AndReturn([usage_obj]) api.nova.tenant_quota_usages(IsA(http.HttpRequest)).AndReturn(quotas) self.mox.ReplayAll() - res = self.client.get(reverse('horizon:syspanel:overview:index')) - self.assertTemplateUsed(res, 'syspanel/overview/usage.html') + res = self.client.get(reverse('horizon:admin:overview:index')) + self.assertTemplateUsed(res, 'admin/overview/usage.html') self.assertTrue(isinstance(res.context['usage'], usage.GlobalUsage)) self.assertContains(res, 'test_tenant' @@ -82,9 +82,9 @@ class UsageViewTests(test.BaseAdminViewTests): .AndReturn([usage_obj]) api.nova.tenant_quota_usages(IsA(http.HttpRequest)).AndReturn(quotas) self.mox.ReplayAll() - csv_url = reverse('horizon:syspanel:overview:index') + "?format=csv" + csv_url = reverse('horizon:admin:overview:index') + "?format=csv" res = self.client.get(csv_url) - self.assertTemplateUsed(res, 'syspanel/overview/usage.csv') + self.assertTemplateUsed(res, 'admin/overview/usage.csv') self.assertTrue(isinstance(res.context['usage'], usage.GlobalUsage)) self.assertContains(res, 'Tenant,VCPUs,RamMB,DiskGB,Usage(Hours)\n' '%s,%s,%s,%s,%f' % diff --git a/horizon/dashboards/syspanel/overview/urls.py b/horizon/dashboards/admin/overview/urls.py similarity index 100% rename from horizon/dashboards/syspanel/overview/urls.py rename to horizon/dashboards/admin/overview/urls.py diff --git a/horizon/dashboards/syspanel/overview/views.py b/horizon/dashboards/admin/overview/views.py similarity index 97% rename from horizon/dashboards/syspanel/overview/views.py rename to horizon/dashboards/admin/overview/views.py index 0d25578eb..dd2e8393d 100644 --- a/horizon/dashboards/syspanel/overview/views.py +++ b/horizon/dashboards/admin/overview/views.py @@ -27,7 +27,7 @@ from horizon import usage class GlobalOverview(usage.UsageView): table_class = usage.GlobalUsageTable usage_class = usage.GlobalUsage - template_name = 'syspanel/overview/usage.html' + template_name = 'admin/overview/usage.html' def get_context_data(self, **kwargs): context = super(GlobalOverview, self).get_context_data(**kwargs) diff --git a/horizon/dashboards/nova/images_and_snapshots/snapshots/__init__.py b/horizon/dashboards/admin/projects/__init__.py similarity index 100% rename from horizon/dashboards/nova/images_and_snapshots/snapshots/__init__.py rename to horizon/dashboards/admin/projects/__init__.py diff --git a/horizon/dashboards/syspanel/projects/forms.py b/horizon/dashboards/admin/projects/forms.py similarity index 94% rename from horizon/dashboards/syspanel/projects/forms.py rename to horizon/dashboards/admin/projects/forms.py index ebccf2416..54ec8d8ca 100644 --- a/horizon/dashboards/syspanel/projects/forms.py +++ b/horizon/dashboards/admin/projects/forms.py @@ -20,7 +20,7 @@ from horizon import api from horizon import forms -from horizon.dashboards.syspanel.users.forms import CreateUserForm +from horizon.dashboards.admin.users.forms import CreateUserForm class CreateUser(CreateUserForm): diff --git a/horizon/dashboards/syspanel/projects/panel.py b/horizon/dashboards/admin/projects/panel.py similarity index 91% rename from horizon/dashboards/syspanel/projects/panel.py rename to horizon/dashboards/admin/projects/panel.py index 7bafadfce..6e0fc0305 100644 --- a/horizon/dashboards/syspanel/projects/panel.py +++ b/horizon/dashboards/admin/projects/panel.py @@ -21,7 +21,7 @@ from django.utils.translation import ugettext_lazy as _ import horizon -from horizon.dashboards.syspanel import dashboard +from horizon.dashboards.admin import dashboard class Tenants(horizon.Panel): @@ -29,4 +29,4 @@ class Tenants(horizon.Panel): slug = 'projects' -dashboard.Syspanel.register(Tenants) +dashboard.Admin.register(Tenants) diff --git a/horizon/dashboards/syspanel/projects/tables.py b/horizon/dashboards/admin/projects/tables.py similarity index 94% rename from horizon/dashboards/syspanel/projects/tables.py rename to horizon/dashboards/admin/projects/tables.py index a5f5ba431..9bc147c77 100644 --- a/horizon/dashboards/syspanel/projects/tables.py +++ b/horizon/dashboards/admin/projects/tables.py @@ -17,7 +17,7 @@ LOG = logging.getLogger(__name__) class ViewMembersLink(tables.LinkAction): name = "users" verbose_name = _("Modify Users") - url = "horizon:syspanel:projects:update" + url = "horizon:admin:projects:update" classes = ("ajax-modal", "btn-edit") def get_link_url(self, project): @@ -30,28 +30,28 @@ class ViewMembersLink(tables.LinkAction): class UsageLink(tables.LinkAction): name = "usage" verbose_name = _("View Usage") - url = "horizon:syspanel:projects:usage" + url = "horizon:admin:projects:usage" classes = ("btn-stats",) class CreateProject(tables.LinkAction): name = "create" verbose_name = _("Create Project") - url = "horizon:syspanel:projects:create" + url = "horizon:admin:projects:create" classes = ("btn-launch", "ajax-modal",) class UpdateProject(tables.LinkAction): name = "update" verbose_name = _("Edit Project") - url = "horizon:syspanel:projects:update" + url = "horizon:admin:projects:update" classes = ("ajax-modal", "btn-edit") class ModifyQuotas(tables.LinkAction): name = "quotas" verbose_name = "Modify Quotas" - url = "horizon:syspanel:projects:update" + url = "horizon:admin:projects:update" classes = ("ajax-modal", "btn-edit") def get_link_url(self, project): @@ -140,7 +140,7 @@ class TenantUsersTable(UsersTable): class AddUserAction(tables.LinkAction): name = "add_user" verbose_name = _("Add To Project") - url = "horizon:syspanel:projects:add_user" + url = "horizon:admin:projects:add_user" classes = ('ajax-modal',) def get_link_url(self, user): diff --git a/horizon/dashboards/syspanel/projects/templates/projects/_add_user.html b/horizon/dashboards/admin/projects/templates/projects/_add_user.html similarity index 73% rename from horizon/dashboards/syspanel/projects/templates/projects/_add_user.html rename to horizon/dashboards/admin/projects/templates/projects/_add_user.html index 413fffdf6..3b365cebd 100644 --- a/horizon/dashboards/syspanel/projects/templates/projects/_add_user.html +++ b/horizon/dashboards/admin/projects/templates/projects/_add_user.html @@ -2,7 +2,7 @@ {% load i18n %} {% block form_id %}add_user_form{% endblock %} -{% block form_action %}{% url horizon:syspanel:projects:add_user tenant_id user_id %}{% endblock %} +{% block form_action %}{% url horizon:admin:projects:add_user tenant_id user_id %}{% endblock %} {% block modal_id %}add_user_modal{% endblock %} {% block modal-header %}{% trans "Add User To Project" %}{% endblock %} @@ -21,5 +21,5 @@ {% block modal-footer %} - {% trans "Cancel" %} + {% trans "Cancel" %} {% endblock %} diff --git a/horizon/dashboards/syspanel/projects/templates/projects/_create.html b/horizon/dashboards/admin/projects/templates/projects/_create.html similarity index 77% rename from horizon/dashboards/syspanel/projects/templates/projects/_create.html rename to horizon/dashboards/admin/projects/templates/projects/_create.html index c923764ac..372878e7e 100644 --- a/horizon/dashboards/syspanel/projects/templates/projects/_create.html +++ b/horizon/dashboards/admin/projects/templates/projects/_create.html @@ -2,7 +2,7 @@ {% load i18n %} {% block form_id %}create_tenant_form{% endblock %} -{% block form_action %}{% url horizon:syspanel:projects:create %}{% endblock %} +{% block form_action %}{% url horizon:admin:projects:create %}{% endblock %} {% block modal_id %}create_tenant_modal{% endblock %} {% block modal-header %}{% trans "Create Project" %}{% endblock %} @@ -21,5 +21,5 @@ {% block modal-footer %} - {% trans "Cancel" %} + {% trans "Cancel" %} {% endblock %} diff --git a/horizon/dashboards/syspanel/projects/templates/projects/_create_user.html b/horizon/dashboards/admin/projects/templates/projects/_create_user.html similarity index 76% rename from horizon/dashboards/syspanel/projects/templates/projects/_create_user.html rename to horizon/dashboards/admin/projects/templates/projects/_create_user.html index bf2005f60..18fcdcad9 100644 --- a/horizon/dashboards/syspanel/projects/templates/projects/_create_user.html +++ b/horizon/dashboards/admin/projects/templates/projects/_create_user.html @@ -2,7 +2,7 @@ {% load i18n %} {% block form_id %}create_user_form{% endblock %} -{% block form_action %}{% url horizon:syspanel:projects:create_user tenant_id %}{% endblock %} +{% block form_action %}{% url horizon:admin:projects:create_user tenant_id %}{% endblock %} {% block modal-header %}{% blocktrans %}Create User for project '{{ tenant_name }}'.{% endblocktrans %}{% endblock %} @@ -21,5 +21,5 @@ {% block modal-footer %} - {% trans "Cancel" %} + {% trans "Cancel" %} {% endblock %} diff --git a/horizon/dashboards/syspanel/projects/templates/projects/_quotas.html b/horizon/dashboards/admin/projects/templates/projects/_quotas.html similarity index 77% rename from horizon/dashboards/syspanel/projects/templates/projects/_quotas.html rename to horizon/dashboards/admin/projects/templates/projects/_quotas.html index f92748476..9bbae7b73 100644 --- a/horizon/dashboards/syspanel/projects/templates/projects/_quotas.html +++ b/horizon/dashboards/admin/projects/templates/projects/_quotas.html @@ -2,7 +2,7 @@ {% load i18n %} {% block form_id %}quota_update_form{% endblock %} -{% block form_action %}{% url horizon:syspanel:projects:quotas tenant.id %}{% endblock %} +{% block form_action %}{% url horizon:admin:projects:quotas tenant.id %}{% endblock %} {% block modal-header %}{% trans "Update Quota" %}{% endblock %} @@ -20,5 +20,5 @@ {% block modal-footer %} - {% trans "Cancel" %} + {% trans "Cancel" %} {% endblock %} diff --git a/horizon/dashboards/syspanel/projects/templates/projects/_update.html b/horizon/dashboards/admin/projects/templates/projects/_update.html similarity index 75% rename from horizon/dashboards/syspanel/projects/templates/projects/_update.html rename to horizon/dashboards/admin/projects/templates/projects/_update.html index 6098dc370..a463e20da 100644 --- a/horizon/dashboards/syspanel/projects/templates/projects/_update.html +++ b/horizon/dashboards/admin/projects/templates/projects/_update.html @@ -2,7 +2,7 @@ {% load i18n %} {% block form_id %}{% endblock %} -{% block form_action %}{% url horizon:syspanel:projects:update tenant.id %}{% endblock %} +{% block form_action %}{% url horizon:admin:projects:update tenant.id %}{% endblock %} {% block modal_id %}update_tenant_modal{% endblock %} {% block modal-header %}{% trans "Update Project" %}{% endblock %} @@ -21,5 +21,5 @@ {% block modal-footer %} - {% trans "Cancel" %} + {% trans "Cancel" %} {% endblock %} diff --git a/horizon/dashboards/syspanel/projects/templates/projects/_update_members.html b/horizon/dashboards/admin/projects/templates/projects/_update_members.html similarity index 100% rename from horizon/dashboards/syspanel/projects/templates/projects/_update_members.html rename to horizon/dashboards/admin/projects/templates/projects/_update_members.html diff --git a/horizon/dashboards/syspanel/projects/templates/projects/add_user.html b/horizon/dashboards/admin/projects/templates/projects/add_user.html similarity index 84% rename from horizon/dashboards/syspanel/projects/templates/projects/add_user.html rename to horizon/dashboards/admin/projects/templates/projects/add_user.html index 4766bd585..536181203 100644 --- a/horizon/dashboards/syspanel/projects/templates/projects/add_user.html +++ b/horizon/dashboards/admin/projects/templates/projects/add_user.html @@ -7,5 +7,5 @@ {% endblock page_header %} {% block main %} - {% include 'syspanel/projects/_add_user.html' %} + {% include 'admin/projects/_add_user.html' %} {% endblock %} diff --git a/horizon/dashboards/syspanel/projects/templates/projects/create.html b/horizon/dashboards/admin/projects/templates/projects/create.html similarity index 100% rename from horizon/dashboards/syspanel/projects/templates/projects/create.html rename to horizon/dashboards/admin/projects/templates/projects/create.html diff --git a/horizon/dashboards/syspanel/projects/templates/projects/create_user.html b/horizon/dashboards/admin/projects/templates/projects/create_user.html similarity index 100% rename from horizon/dashboards/syspanel/projects/templates/projects/create_user.html rename to horizon/dashboards/admin/projects/templates/projects/create_user.html diff --git a/horizon/dashboards/syspanel/projects/templates/projects/index.html b/horizon/dashboards/admin/projects/templates/projects/index.html similarity index 86% rename from horizon/dashboards/syspanel/projects/templates/projects/index.html rename to horizon/dashboards/admin/projects/templates/projects/index.html index dcd9e3142..7bb3429ad 100644 --- a/horizon/dashboards/syspanel/projects/templates/projects/index.html +++ b/horizon/dashboards/admin/projects/templates/projects/index.html @@ -3,7 +3,7 @@ {% block title %}Projects{% endblock %} {% block page_header %} - {% url horizon:syspanel:projects:index as refresh_link %} + {% url horizon:admin:projects:index as refresh_link %} {# to make searchable false, just remove it from the include statement #} {% include "horizon/common/_page_header.html" with title=_("Projects") refresh_link=refresh_link searchable="true" %} {% endblock page_header %} diff --git a/horizon/dashboards/syspanel/projects/templates/projects/quotas.html b/horizon/dashboards/admin/projects/templates/projects/quotas.html similarity index 79% rename from horizon/dashboards/syspanel/projects/templates/projects/quotas.html rename to horizon/dashboards/admin/projects/templates/projects/quotas.html index 4f4374ad3..99a143f7c 100644 --- a/horizon/dashboards/syspanel/projects/templates/projects/quotas.html +++ b/horizon/dashboards/admin/projects/templates/projects/quotas.html @@ -7,5 +7,5 @@ {% endblock page_header %} {% block main %} - {% include 'syspanel/projects/_quotas.html' with form=form %} + {% include 'admin/projects/_quotas.html' with form=form %} {% endblock %} diff --git a/horizon/dashboards/syspanel/projects/templates/projects/update.html b/horizon/dashboards/admin/projects/templates/projects/update.html similarity index 100% rename from horizon/dashboards/syspanel/projects/templates/projects/update.html rename to horizon/dashboards/admin/projects/templates/projects/update.html diff --git a/horizon/dashboards/syspanel/projects/templates/projects/usage.csv b/horizon/dashboards/admin/projects/templates/projects/usage.csv similarity index 100% rename from horizon/dashboards/syspanel/projects/templates/projects/usage.csv rename to horizon/dashboards/admin/projects/templates/projects/usage.csv diff --git a/horizon/dashboards/syspanel/projects/templates/projects/usage.html b/horizon/dashboards/admin/projects/templates/projects/usage.html similarity index 100% rename from horizon/dashboards/syspanel/projects/templates/projects/usage.html rename to horizon/dashboards/admin/projects/templates/projects/usage.html diff --git a/horizon/dashboards/syspanel/projects/templates/projects/users.html b/horizon/dashboards/admin/projects/templates/projects/users.html similarity index 100% rename from horizon/dashboards/syspanel/projects/templates/projects/users.html rename to horizon/dashboards/admin/projects/templates/projects/users.html diff --git a/horizon/dashboards/syspanel/projects/tests.py b/horizon/dashboards/admin/projects/tests.py similarity index 96% rename from horizon/dashboards/syspanel/projects/tests.py rename to horizon/dashboards/admin/projects/tests.py index 94243c457..f6a973195 100644 --- a/horizon/dashboards/syspanel/projects/tests.py +++ b/horizon/dashboards/admin/projects/tests.py @@ -24,7 +24,7 @@ from horizon import test from .workflows import CreateProject, UpdateProject from .views import QUOTA_FIELDS -INDEX_URL = reverse('horizon:syspanel:projects:index') +INDEX_URL = reverse('horizon:admin:projects:index') class TenantsViewTests(test.BaseAdminViewTests): @@ -35,7 +35,7 @@ class TenantsViewTests(test.BaseAdminViewTests): self.mox.ReplayAll() res = self.client.get(INDEX_URL) - self.assertTemplateUsed(res, 'syspanel/projects/index.html') + self.assertTemplateUsed(res, 'admin/projects/index.html') self.assertItemsEqual(res.context['table'].data, self.tenants.list()) @@ -84,10 +84,10 @@ class CreateProjectWorkflowTests(test.BaseAdminViewTests): self.mox.ReplayAll() - url = reverse('horizon:syspanel:projects:create') + url = reverse('horizon:admin:projects:create') res = self.client.get(url) - self.assertTemplateUsed(res, 'syspanel/projects/create.html') + self.assertTemplateUsed(res, 'admin/projects/create.html') workflow = res.context['workflow'] self.assertEqual(res.context['workflow'].name, CreateProject.name) @@ -153,7 +153,7 @@ class CreateProjectWorkflowTests(test.BaseAdminViewTests): workflow_data.update(self._get_workflow_data(project, quota)) - url = reverse('horizon:syspanel:projects:create') + url = reverse('horizon:admin:projects:create') res = self.client.post(url, workflow_data) self.assertNoFormErrors(res) @@ -178,10 +178,10 @@ class CreateProjectWorkflowTests(test.BaseAdminViewTests): self.mox.ReplayAll() - url = reverse('horizon:syspanel:projects:create') + url = reverse('horizon:admin:projects:create') res = self.client.get(url) - self.assertTemplateUsed(res, 'syspanel/projects/create.html') + self.assertTemplateUsed(res, 'admin/projects/create.html') self.assertContains(res, "Unable to retrieve default quota values") @test.create_stubs({api: ('get_default_role', @@ -217,7 +217,7 @@ class CreateProjectWorkflowTests(test.BaseAdminViewTests): workflow_data = self._get_workflow_data(project, quota) - url = reverse('horizon:syspanel:projects:create') + url = reverse('horizon:admin:projects:create') res = self.client.post(url, workflow_data) self.assertNoFormErrors(res) @@ -276,7 +276,7 @@ class CreateProjectWorkflowTests(test.BaseAdminViewTests): workflow_data.update(self._get_workflow_data(project, quota)) - url = reverse('horizon:syspanel:projects:create') + url = reverse('horizon:admin:projects:create') res = self.client.post(url, workflow_data) self.assertNoFormErrors(res) @@ -337,7 +337,7 @@ class CreateProjectWorkflowTests(test.BaseAdminViewTests): workflow_data.update(self._get_workflow_data(project, quota)) - url = reverse('horizon:syspanel:projects:create') + url = reverse('horizon:admin:projects:create') res = self.client.post(url, workflow_data) self.assertNoFormErrors(res) @@ -370,7 +370,7 @@ class CreateProjectWorkflowTests(test.BaseAdminViewTests): workflow_data = self._get_workflow_data(project, quota) workflow_data["name"] = "" - url = reverse('horizon:syspanel:projects:create') + url = reverse('horizon:admin:projects:create') res = self.client.post(url, workflow_data) self.assertContains(res, "field is required") @@ -412,11 +412,11 @@ class UpdateProjectWorkflowTests(test.BaseAdminViewTests): self.mox.ReplayAll() - url = reverse('horizon:syspanel:projects:update', + url = reverse('horizon:admin:projects:update', args=[self.tenant.id]) res = self.client.get(url) - self.assertTemplateUsed(res, 'syspanel/projects/update.html') + self.assertTemplateUsed(res, 'admin/projects/update.html') workflow = res.context['workflow'] self.assertEqual(res.context['workflow'].name, UpdateProject.name) @@ -537,7 +537,7 @@ class UpdateProjectWorkflowTests(test.BaseAdminViewTests): "enabled": project.enabled} workflow_data.update(project_data) workflow_data.update(updated_quota) - url = reverse('horizon:syspanel:projects:update', + url = reverse('horizon:admin:projects:update', args=[self.tenant.id]) res = self.client.post(url, workflow_data) @@ -552,7 +552,7 @@ class UpdateProjectWorkflowTests(test.BaseAdminViewTests): self.mox.ReplayAll() - url = reverse('horizon:syspanel:projects:update', + url = reverse('horizon:admin:projects:update', args=[self.tenant.id]) res = self.client.get(url) @@ -623,7 +623,7 @@ class UpdateProjectWorkflowTests(test.BaseAdminViewTests): "enabled": project.enabled} workflow_data.update(project_data) workflow_data.update(updated_quota) - url = reverse('horizon:syspanel:projects:update', + url = reverse('horizon:admin:projects:update', args=[self.tenant.id]) res = self.client.post(url, workflow_data) @@ -735,7 +735,7 @@ class UpdateProjectWorkflowTests(test.BaseAdminViewTests): "enabled": project.enabled} workflow_data.update(project_data) workflow_data.update(updated_quota) - url = reverse('horizon:syspanel:projects:update', + url = reverse('horizon:admin:projects:update', args=[self.tenant.id]) res = self.client.post(url, workflow_data) @@ -834,7 +834,7 @@ class UpdateProjectWorkflowTests(test.BaseAdminViewTests): "enabled": project.enabled} workflow_data.update(project_data) workflow_data.update(updated_quota) - url = reverse('horizon:syspanel:projects:update', + url = reverse('horizon:admin:projects:update', args=[self.tenant.id]) res = self.client.post(url, workflow_data) diff --git a/horizon/dashboards/syspanel/projects/urls.py b/horizon/dashboards/admin/projects/urls.py similarity index 100% rename from horizon/dashboards/syspanel/projects/urls.py rename to horizon/dashboards/admin/projects/urls.py diff --git a/horizon/dashboards/syspanel/projects/views.py b/horizon/dashboards/admin/projects/views.py similarity index 93% rename from horizon/dashboards/syspanel/projects/views.py rename to horizon/dashboards/admin/projects/views.py index a46ba4e45..8a34caa5a 100644 --- a/horizon/dashboards/syspanel/projects/views.py +++ b/horizon/dashboards/admin/projects/views.py @@ -28,7 +28,7 @@ from horizon import exceptions from horizon import tables from horizon import usage from horizon import workflows -from horizon.dashboards.syspanel.users.views import CreateView +from horizon.dashboards.admin.users.views import CreateView from .forms import CreateUser from .tables import TenantsTable, TenantUsersTable, AddUsersTable @@ -51,7 +51,7 @@ PROJECT_INFO_FIELDS = ("name", "description", "enabled") -INDEX_URL = "horizon:syspanel:projects:index" +INDEX_URL = "horizon:admin:projects:index" class TenantContextMixin(object): @@ -76,7 +76,7 @@ class TenantContextMixin(object): class IndexView(tables.DataTableView): table_class = TenantsTable - template_name = 'syspanel/projects/index.html' + template_name = 'admin/projects/index.html' def get_data(self): tenants = [] @@ -91,7 +91,7 @@ class IndexView(tables.DataTableView): class UsersView(tables.MultiTableView): table_classes = (TenantUsersTable, AddUsersTable) - template_name = 'syspanel/projects/users.html' + template_name = 'admin/projects/users.html' def _get_shared_data(self, *args, **kwargs): tenant_id = self.kwargs["tenant_id"] @@ -129,7 +129,7 @@ class UsersView(tables.MultiTableView): class TenantUsageView(usage.UsageView): table_class = usage.TenantUsageTable usage_class = usage.TenantUsage - template_name = 'syspanel/projects/usage.html' + template_name = 'admin/projects/usage.html' def get_data(self): super(TenantUsageView, self).get_data() @@ -138,7 +138,7 @@ class TenantUsageView(usage.UsageView): class CreateProjectView(workflows.WorkflowView): workflow_class = CreateProject - template_name = "syspanel/projects/create.html" + template_name = "admin/projects/create.html" def get_initial(self): initial = super(CreateProjectView, self).get_initial() @@ -159,7 +159,7 @@ class CreateProjectView(workflows.WorkflowView): class UpdateProjectView(workflows.WorkflowView): workflow_class = UpdateProject - template_name = "syspanel/projects/update.html" + template_name = "admin/projects/update.html" def get_initial(self): initial = super(UpdateProjectView, self).get_initial() @@ -186,8 +186,8 @@ class UpdateProjectView(workflows.WorkflowView): class CreateUserView(CreateView): form_class = CreateUser - template_name = "syspanel/projects/create_user.html" - success_url = reverse_lazy('horizon:syspanel:projects:index') + template_name = "admin/projects/create_user.html" + success_url = reverse_lazy('horizon:admin:projects:index') def get_initial(self): default_role = api.keystone.get_default_role(self.request) diff --git a/horizon/dashboards/syspanel/projects/workflows.py b/horizon/dashboards/admin/projects/workflows.py similarity index 98% rename from horizon/dashboards/syspanel/projects/workflows.py rename to horizon/dashboards/admin/projects/workflows.py index 6d6e81af6..b4fae679a 100644 --- a/horizon/dashboards/syspanel/projects/workflows.py +++ b/horizon/dashboards/admin/projects/workflows.py @@ -27,8 +27,8 @@ from horizon import exceptions from horizon import workflows from horizon import forms -INDEX_URL = "horizon:syspanel:projects:index" -ADD_USER_URL = "horizon:syspanel:projects:create_user" +INDEX_URL = "horizon:admin:projects:index" +ADD_USER_URL = "horizon:admin:projects:create_user" class UpdateProjectQuotaAction(workflows.Action): @@ -156,7 +156,7 @@ class UpdateProjectMembersAction(workflows.Action): class UpdateProjectMembers(workflows.Step): action_class = UpdateProjectMembersAction - template_name = "syspanel/projects/_update_members.html" + template_name = "admin/projects/_update_members.html" def contribute(self, data, context): if data: @@ -179,7 +179,7 @@ class CreateProject(workflows.Workflow): finalize_button_name = _("Finish") success_message = _('Created new project "%s".') failure_message = _('Unable to create project "%s".') - success_url = "horizon:syspanel:projects:index" + success_url = "horizon:admin:projects:index" default_steps = (CreateProjectInfo, UpdateProjectMembers, UpdateProjectQuota) @@ -268,7 +268,7 @@ class UpdateProject(workflows.Workflow): finalize_button_name = _("Save") success_message = _('Modified project "%s".') failure_message = _('Unable to modify project "%s".') - success_url = "horizon:syspanel:projects:index" + success_url = "horizon:admin:projects:index" default_steps = (UpdateProjectInfo, UpdateProjectMembers, UpdateProjectQuota) diff --git a/horizon/dashboards/nova/images_and_snapshots/volume_snapshots/__init__.py b/horizon/dashboards/admin/quotas/__init__.py similarity index 100% rename from horizon/dashboards/nova/images_and_snapshots/volume_snapshots/__init__.py rename to horizon/dashboards/admin/quotas/__init__.py diff --git a/horizon/dashboards/syspanel/quotas/panel.py b/horizon/dashboards/admin/quotas/panel.py similarity index 91% rename from horizon/dashboards/syspanel/quotas/panel.py rename to horizon/dashboards/admin/quotas/panel.py index 25bf17821..c7f1c4bf4 100644 --- a/horizon/dashboards/syspanel/quotas/panel.py +++ b/horizon/dashboards/admin/quotas/panel.py @@ -21,7 +21,7 @@ from django.utils.translation import ugettext_lazy as _ import horizon -from horizon.dashboards.syspanel import dashboard +from horizon.dashboards.admin import dashboard class Quotas(horizon.Panel): @@ -29,4 +29,4 @@ class Quotas(horizon.Panel): slug = 'quotas' -dashboard.Syspanel.register(Quotas) +dashboard.Admin.register(Quotas) diff --git a/horizon/dashboards/syspanel/quotas/tables.py b/horizon/dashboards/admin/quotas/tables.py similarity index 100% rename from horizon/dashboards/syspanel/quotas/tables.py rename to horizon/dashboards/admin/quotas/tables.py diff --git a/horizon/dashboards/syspanel/quotas/templates/quotas/index.html b/horizon/dashboards/admin/quotas/templates/quotas/index.html similarity index 86% rename from horizon/dashboards/syspanel/quotas/templates/quotas/index.html rename to horizon/dashboards/admin/quotas/templates/quotas/index.html index 86a3827be..0650cf021 100644 --- a/horizon/dashboards/syspanel/quotas/templates/quotas/index.html +++ b/horizon/dashboards/admin/quotas/templates/quotas/index.html @@ -3,7 +3,7 @@ {% block title %}Quotas{% endblock %} {% block page_header %} - {% url horizon:syspanel:quotas:index as refresh_link %} + {% url horizon:admin:quotas:index as refresh_link %} {# to make searchable false, just remove it from the include statement #} {% include "horizon/common/_page_header.html" with title=_("Default Quotas") refresh_link=refresh_link searchable="true" %} {% endblock page_header %} diff --git a/horizon/dashboards/syspanel/quotas/tests.py b/horizon/dashboards/admin/quotas/tests.py similarity index 100% rename from horizon/dashboards/syspanel/quotas/tests.py rename to horizon/dashboards/admin/quotas/tests.py diff --git a/horizon/dashboards/syspanel/quotas/urls.py b/horizon/dashboards/admin/quotas/urls.py similarity index 93% rename from horizon/dashboards/syspanel/quotas/urls.py rename to horizon/dashboards/admin/quotas/urls.py index 48c47f1c4..45e1fd7f0 100644 --- a/horizon/dashboards/syspanel/quotas/urls.py +++ b/horizon/dashboards/admin/quotas/urls.py @@ -23,5 +23,5 @@ from django.conf.urls.defaults import patterns, url from .views import IndexView -urlpatterns = patterns('horizon.dashboards.syspanel.quotas.views', +urlpatterns = patterns('horizon.dashboards.admin.quotas.views', url(r'^$', IndexView.as_view(), name='index')) diff --git a/horizon/dashboards/syspanel/quotas/views.py b/horizon/dashboards/admin/quotas/views.py similarity index 96% rename from horizon/dashboards/syspanel/quotas/views.py rename to horizon/dashboards/admin/quotas/views.py index 3691d3748..d8e548041 100644 --- a/horizon/dashboards/syspanel/quotas/views.py +++ b/horizon/dashboards/admin/quotas/views.py @@ -33,7 +33,7 @@ LOG = logging.getLogger(__name__) class IndexView(tables.DataTableView): table_class = QuotasTable - template_name = 'syspanel/quotas/index.html' + template_name = 'admin/quotas/index.html' def get_data(self): try: diff --git a/horizon/dashboards/nova/instances/__init__.py b/horizon/dashboards/admin/services/__init__.py similarity index 100% rename from horizon/dashboards/nova/instances/__init__.py rename to horizon/dashboards/admin/services/__init__.py diff --git a/horizon/dashboards/syspanel/services/panel.py b/horizon/dashboards/admin/services/panel.py similarity index 91% rename from horizon/dashboards/syspanel/services/panel.py rename to horizon/dashboards/admin/services/panel.py index 170fa4f49..19541e9fb 100644 --- a/horizon/dashboards/syspanel/services/panel.py +++ b/horizon/dashboards/admin/services/panel.py @@ -21,7 +21,7 @@ from django.utils.translation import ugettext_lazy as _ import horizon -from horizon.dashboards.syspanel import dashboard +from horizon.dashboards.admin import dashboard class Services(horizon.Panel): @@ -29,4 +29,4 @@ class Services(horizon.Panel): slug = 'services' -dashboard.Syspanel.register(Services) +dashboard.Admin.register(Services) diff --git a/horizon/dashboards/syspanel/services/tables.py b/horizon/dashboards/admin/services/tables.py similarity index 94% rename from horizon/dashboards/syspanel/services/tables.py rename to horizon/dashboards/admin/services/tables.py index 71f61be66..fd9aa8cad 100644 --- a/horizon/dashboards/syspanel/services/tables.py +++ b/horizon/dashboards/admin/services/tables.py @@ -22,7 +22,7 @@ class ServiceFilterAction(tables.FilterAction): def get_stats(service): - return template.loader.render_to_string('syspanel/services/_stats.html', + return template.loader.render_to_string('admin/services/_stats.html', {'service': service}) diff --git a/horizon/dashboards/syspanel/services/templates/services/index.html b/horizon/dashboards/admin/services/templates/services/index.html similarity index 86% rename from horizon/dashboards/syspanel/services/templates/services/index.html rename to horizon/dashboards/admin/services/templates/services/index.html index b38d8d68c..abfba78dd 100644 --- a/horizon/dashboards/syspanel/services/templates/services/index.html +++ b/horizon/dashboards/admin/services/templates/services/index.html @@ -3,7 +3,7 @@ {% block title %}Services{% endblock %} {% block page_header %} - {% url horizon:syspanel:services:index as refresh_link %} + {% url horizon:admin:services:index as refresh_link %} {# to make searchable false, just remove it from the include statement #} {% include "horizon/common/_page_header.html" with title=_("Services") refresh_link=refresh_link searchable="true" %} {% endblock page_header %} diff --git a/horizon/dashboards/syspanel/services/tests.py b/horizon/dashboards/admin/services/tests.py similarity index 91% rename from horizon/dashboards/syspanel/services/tests.py rename to horizon/dashboards/admin/services/tests.py index dbbedce9a..055c9a7fd 100644 --- a/horizon/dashboards/syspanel/services/tests.py +++ b/horizon/dashboards/admin/services/tests.py @@ -19,13 +19,13 @@ from django.core.urlresolvers import reverse from horizon import test -INDEX_URL = reverse('horizon:syspanel:services:index') +INDEX_URL = reverse('horizon:admin:services:index') class ServicessViewTests(test.BaseAdminViewTests): def test_index(self): res = self.client.get(INDEX_URL) - self.assertTemplateUsed(res, 'syspanel/services/index.html') + self.assertTemplateUsed(res, 'admin/services/index.html') self.assertQuerysetEqual(res.context['table'].data, ['', '', diff --git a/horizon/dashboards/syspanel/services/urls.py b/horizon/dashboards/admin/services/urls.py similarity index 93% rename from horizon/dashboards/syspanel/services/urls.py rename to horizon/dashboards/admin/services/urls.py index 556ee9179..11a771017 100644 --- a/horizon/dashboards/syspanel/services/urls.py +++ b/horizon/dashboards/admin/services/urls.py @@ -23,5 +23,5 @@ from django.conf.urls.defaults import patterns, url from .views import IndexView -urlpatterns = patterns('horizon.dashboards.syspanel.services.views', +urlpatterns = patterns('horizon.dashboards.admin.services.views', url(r'^$', IndexView.as_view(), name='index')) diff --git a/horizon/dashboards/syspanel/services/views.py b/horizon/dashboards/admin/services/views.py similarity index 96% rename from horizon/dashboards/syspanel/services/views.py rename to horizon/dashboards/admin/services/views.py index 480c865ec..af449f388 100644 --- a/horizon/dashboards/syspanel/services/views.py +++ b/horizon/dashboards/admin/services/views.py @@ -30,7 +30,7 @@ LOG = logging.getLogger(__name__) class IndexView(tables.DataTableView): table_class = ServicesTable - template_name = 'syspanel/services/index.html' + template_name = 'admin/services/index.html' def get_data(self): services = [] diff --git a/horizon/dashboards/nova/networks/__init__.py b/horizon/dashboards/admin/users/__init__.py similarity index 100% rename from horizon/dashboards/nova/networks/__init__.py rename to horizon/dashboards/admin/users/__init__.py diff --git a/horizon/dashboards/syspanel/users/forms.py b/horizon/dashboards/admin/users/forms.py similarity index 99% rename from horizon/dashboards/syspanel/users/forms.py rename to horizon/dashboards/admin/users/forms.py index c12ac9ec9..3ba7cdb2b 100644 --- a/horizon/dashboards/syspanel/users/forms.py +++ b/horizon/dashboards/admin/users/forms.py @@ -54,7 +54,7 @@ class BaseUserForm(forms.SelfHandlingForm): return data -ADD_PROJECT_URL = "horizon:syspanel:projects:create" +ADD_PROJECT_URL = "horizon:admin:projects:create" class CreateUserForm(BaseUserForm): diff --git a/horizon/dashboards/syspanel/users/panel.py b/horizon/dashboards/admin/users/panel.py similarity index 91% rename from horizon/dashboards/syspanel/users/panel.py rename to horizon/dashboards/admin/users/panel.py index 8e9536b41..d59a9f9d3 100644 --- a/horizon/dashboards/syspanel/users/panel.py +++ b/horizon/dashboards/admin/users/panel.py @@ -21,7 +21,7 @@ from django.utils.translation import ugettext_lazy as _ import horizon -from horizon.dashboards.syspanel import dashboard +from horizon.dashboards.admin import dashboard class Users(horizon.Panel): @@ -29,4 +29,4 @@ class Users(horizon.Panel): slug = 'users' -dashboard.Syspanel.register(Users) +dashboard.Admin.register(Users) diff --git a/horizon/dashboards/syspanel/users/tables.py b/horizon/dashboards/admin/users/tables.py similarity index 97% rename from horizon/dashboards/syspanel/users/tables.py rename to horizon/dashboards/admin/users/tables.py index bc405175d..9c1aec1ae 100644 --- a/horizon/dashboards/syspanel/users/tables.py +++ b/horizon/dashboards/admin/users/tables.py @@ -17,7 +17,7 @@ DISABLE = 1 class CreateUserLink(tables.LinkAction): name = "create" verbose_name = _("Create User") - url = "horizon:syspanel:users:create" + url = "horizon:admin:users:create" classes = ("ajax-modal", "btn-create") def allowed(self, request, user): @@ -29,7 +29,7 @@ class CreateUserLink(tables.LinkAction): class EditUserLink(tables.LinkAction): name = "edit" verbose_name = _("Edit") - url = "horizon:syspanel:users:update" + url = "horizon:admin:users:update" classes = ("ajax-modal", "btn-edit") diff --git a/horizon/dashboards/syspanel/users/templates/users/_create.html b/horizon/dashboards/admin/users/templates/users/_create.html similarity index 76% rename from horizon/dashboards/syspanel/users/templates/users/_create.html rename to horizon/dashboards/admin/users/templates/users/_create.html index f72c166b8..ddcdc6d56 100644 --- a/horizon/dashboards/syspanel/users/templates/users/_create.html +++ b/horizon/dashboards/admin/users/templates/users/_create.html @@ -2,7 +2,7 @@ {% load i18n %} {% block form_id %}create_user_form{% endblock %} -{% block form_action %}{% url horizon:syspanel:users:create %}{% endblock %} +{% block form_action %}{% url horizon:admin:users:create %}{% endblock %} {% block modal-header %}{% trans "Create User" %}{% endblock %} @@ -20,5 +20,5 @@ {% block modal-footer %} - {% trans "Cancel" %} + {% trans "Cancel" %} {% endblock %} diff --git a/horizon/dashboards/syspanel/users/templates/users/_update.html b/horizon/dashboards/admin/users/templates/users/_update.html similarity index 76% rename from horizon/dashboards/syspanel/users/templates/users/_update.html rename to horizon/dashboards/admin/users/templates/users/_update.html index b324345f0..9e662e6cf 100644 --- a/horizon/dashboards/syspanel/users/templates/users/_update.html +++ b/horizon/dashboards/admin/users/templates/users/_update.html @@ -2,7 +2,7 @@ {% load i18n %} {% block form_id %}update_user_form{% endblock %} -{% block form_action %}{% url horizon:syspanel:users:update user.id %}{% endblock %} +{% block form_action %}{% url horizon:admin:users:update user.id %}{% endblock %} {% block modal-header %}{% trans "Update User" %}{% endblock %} @@ -20,5 +20,5 @@ {% block modal-footer %} - {% trans "Cancel" %} + {% trans "Cancel" %} {% endblock %} diff --git a/horizon/dashboards/syspanel/users/templates/users/create.html b/horizon/dashboards/admin/users/templates/users/create.html similarity index 87% rename from horizon/dashboards/syspanel/users/templates/users/create.html rename to horizon/dashboards/admin/users/templates/users/create.html index f44e77d6c..6315a7546 100644 --- a/horizon/dashboards/syspanel/users/templates/users/create.html +++ b/horizon/dashboards/admin/users/templates/users/create.html @@ -8,5 +8,5 @@ {% endblock page_header %} {% block main %} - {% include 'syspanel/users/_create.html' %} + {% include 'admin/users/_create.html' %} {% endblock %} diff --git a/horizon/dashboards/syspanel/users/templates/users/index.html b/horizon/dashboards/admin/users/templates/users/index.html similarity index 86% rename from horizon/dashboards/syspanel/users/templates/users/index.html rename to horizon/dashboards/admin/users/templates/users/index.html index 657bff648..e48701aeb 100644 --- a/horizon/dashboards/syspanel/users/templates/users/index.html +++ b/horizon/dashboards/admin/users/templates/users/index.html @@ -3,7 +3,7 @@ {% block title %}Users{% endblock %} {% block page_header %} - {% url horizon:syspanel:users:index as refresh_link %} + {% url horizon:admin:users:index as refresh_link %} {# to make searchable false, just remove it from the include statement #} {% include "horizon/common/_page_header.html" with title=_("Users") refresh_link=refresh_link searchable="true" %} {% endblock page_header %} diff --git a/horizon/dashboards/syspanel/users/templates/users/update.html b/horizon/dashboards/admin/users/templates/users/update.html similarity index 87% rename from horizon/dashboards/syspanel/users/templates/users/update.html rename to horizon/dashboards/admin/users/templates/users/update.html index d0f000fab..b28017560 100644 --- a/horizon/dashboards/syspanel/users/templates/users/update.html +++ b/horizon/dashboards/admin/users/templates/users/update.html @@ -8,5 +8,5 @@ {% endblock page_header %} {% block main %} - {% include 'syspanel/users/_update.html' %} + {% include 'admin/users/_update.html' %} {% endblock %} diff --git a/horizon/dashboards/syspanel/users/tests.py b/horizon/dashboards/admin/users/tests.py similarity index 98% rename from horizon/dashboards/syspanel/users/tests.py rename to horizon/dashboards/admin/users/tests.py index b2cd75b28..e99566fad 100644 --- a/horizon/dashboards/syspanel/users/tests.py +++ b/horizon/dashboards/admin/users/tests.py @@ -26,9 +26,9 @@ from horizon import api from horizon import test -USERS_INDEX_URL = reverse('horizon:syspanel:users:index') -USER_CREATE_URL = reverse('horizon:syspanel:users:create') -USER_UPDATE_URL = reverse('horizon:syspanel:users:update', args=[1]) +USERS_INDEX_URL = reverse('horizon:admin:users:index') +USER_CREATE_URL = reverse('horizon:admin:users:create') +USER_UPDATE_URL = reverse('horizon:admin:users:update', args=[1]) class UsersViewTests(test.BaseAdminViewTests): @@ -40,7 +40,7 @@ class UsersViewTests(test.BaseAdminViewTests): res = self.client.get(USERS_INDEX_URL) - self.assertTemplateUsed(res, 'syspanel/users/index.html') + self.assertTemplateUsed(res, 'admin/users/index.html') self.assertItemsEqual(res.context['table'].data, self.users.list()) @test.create_stubs({api: ('user_create', diff --git a/horizon/dashboards/syspanel/users/urls.py b/horizon/dashboards/admin/users/urls.py similarity index 94% rename from horizon/dashboards/syspanel/users/urls.py rename to horizon/dashboards/admin/users/urls.py index ea796d13e..ee2b4a2f6 100644 --- a/horizon/dashboards/syspanel/users/urls.py +++ b/horizon/dashboards/admin/users/urls.py @@ -22,7 +22,7 @@ from django.conf.urls.defaults import patterns, url from .views import IndexView, CreateView, UpdateView -urlpatterns = patterns('horizon.dashboards.syspanel.users.views', +urlpatterns = patterns('horizon.dashboards.admin.users.views', url(r'^$', IndexView.as_view(), name='index'), url(r'^(?P[^/]+)/update/$', UpdateView.as_view(), name='update'), url(r'^create/$', CreateView.as_view(), name='create')) diff --git a/horizon/dashboards/syspanel/users/views.py b/horizon/dashboards/admin/users/views.py similarity index 90% rename from horizon/dashboards/syspanel/users/views.py rename to horizon/dashboards/admin/users/views.py index de7d1c91a..23a972b3b 100644 --- a/horizon/dashboards/syspanel/users/views.py +++ b/horizon/dashboards/admin/users/views.py @@ -35,7 +35,7 @@ from .tables import UsersTable class IndexView(tables.DataTableView): table_class = UsersTable - template_name = 'syspanel/users/index.html' + template_name = 'admin/users/index.html' def get_data(self): users = [] @@ -49,8 +49,8 @@ class IndexView(tables.DataTableView): class UpdateView(forms.ModalFormView): form_class = UpdateUserForm - template_name = 'syspanel/users/update.html' - success_url = reverse_lazy('horizon:syspanel:users:index') + template_name = 'admin/users/update.html' + success_url = reverse_lazy('horizon:admin:users:index') @method_decorator(sensitive_post_parameters('password', 'confirm_password')) @@ -64,7 +64,7 @@ class UpdateView(forms.ModalFormView): self.kwargs['user_id'], admin=True) except: - redirect = reverse("horizon:syspanel:users:index") + redirect = reverse("horizon:admin:users:index") exceptions.handle(self.request, _('Unable to update user.'), redirect=redirect) @@ -85,8 +85,8 @@ class UpdateView(forms.ModalFormView): class CreateView(forms.ModalFormView): form_class = CreateUserForm - template_name = 'syspanel/users/create.html' - success_url = reverse_lazy('horizon:syspanel:users:index') + template_name = 'admin/users/create.html' + success_url = reverse_lazy('horizon:admin:users:index') @method_decorator(sensitive_post_parameters('password', 'confirm_password')) @@ -98,7 +98,7 @@ class CreateView(forms.ModalFormView): try: roles = api.keystone.role_list(self.request) except: - redirect = reverse("horizon:syspanel:users:index") + redirect = reverse("horizon:admin:users:index") exceptions.handle(self.request, _("Unable to retrieve user roles."), redirect=redirect) diff --git a/horizon/dashboards/nova/networks/ports/__init__.py b/horizon/dashboards/admin/volumes/__init__.py similarity index 100% rename from horizon/dashboards/nova/networks/ports/__init__.py rename to horizon/dashboards/admin/volumes/__init__.py diff --git a/horizon/dashboards/syspanel/volumes/panel.py b/horizon/dashboards/admin/volumes/panel.py similarity index 69% rename from horizon/dashboards/syspanel/volumes/panel.py rename to horizon/dashboards/admin/volumes/panel.py index 4c3159398..5ee2502b0 100644 --- a/horizon/dashboards/syspanel/volumes/panel.py +++ b/horizon/dashboards/admin/volumes/panel.py @@ -2,7 +2,7 @@ from django.utils.translation import ugettext_lazy as _ import horizon -from horizon.dashboards.syspanel import dashboard +from horizon.dashboards.admin import dashboard class Volumes(horizon.Panel): @@ -11,4 +11,4 @@ class Volumes(horizon.Panel): permissions = ('openstack.services.volume',) -dashboard.Syspanel.register(Volumes) +dashboard.Admin.register(Volumes) diff --git a/horizon/dashboards/syspanel/volumes/tables.py b/horizon/dashboards/admin/volumes/tables.py similarity index 79% rename from horizon/dashboards/syspanel/volumes/tables.py rename to horizon/dashboards/admin/volumes/tables.py index 91f11909f..de3563ffe 100644 --- a/horizon/dashboards/syspanel/volumes/tables.py +++ b/horizon/dashboards/admin/volumes/tables.py @@ -1,14 +1,14 @@ from django.utils.translation import ugettext_lazy as _ from horizon import tables -from horizon.dashboards.nova.volumes.tables import (UpdateRow, +from horizon.dashboards.project.volumes.tables import (UpdateRow, VolumesTable as _VolumesTable, DeleteVolume) class VolumesTable(_VolumesTable): name = tables.Column("display_name", verbose_name=_("Name"), - link="horizon:syspanel:volumes:detail") + link="horizon:admin:volumes:detail") class Meta: name = "volumes" diff --git a/horizon/dashboards/nova/volumes/templates/volumes/detail.html b/horizon/dashboards/admin/volumes/templates/volumes/detail.html similarity index 100% rename from horizon/dashboards/nova/volumes/templates/volumes/detail.html rename to horizon/dashboards/admin/volumes/templates/volumes/detail.html diff --git a/horizon/dashboards/syspanel/volumes/templates/volumes/index.html b/horizon/dashboards/admin/volumes/templates/volumes/index.html similarity index 100% rename from horizon/dashboards/syspanel/volumes/templates/volumes/index.html rename to horizon/dashboards/admin/volumes/templates/volumes/index.html diff --git a/horizon/dashboards/syspanel/volumes/tests.py b/horizon/dashboards/admin/volumes/tests.py similarity index 90% rename from horizon/dashboards/syspanel/volumes/tests.py rename to horizon/dashboards/admin/volumes/tests.py index 22acdadec..b35763ce2 100644 --- a/horizon/dashboards/syspanel/volumes/tests.py +++ b/horizon/dashboards/admin/volumes/tests.py @@ -31,9 +31,9 @@ class VolumeTests(test.BaseAdminViewTests): self.mox.ReplayAll() - res = self.client.get(reverse('horizon:syspanel:volumes:index')) + res = self.client.get(reverse('horizon:admin:volumes:index')) - self.assertTemplateUsed(res, 'syspanel/volumes/index.html') + self.assertTemplateUsed(res, 'admin/volumes/index.html') volumes = res.context['volumes_table'].data self.assertItemsEqual(volumes, self.volumes.list()) diff --git a/horizon/dashboards/syspanel/volumes/urls.py b/horizon/dashboards/admin/volumes/urls.py similarity index 100% rename from horizon/dashboards/syspanel/volumes/urls.py rename to horizon/dashboards/admin/volumes/urls.py diff --git a/horizon/dashboards/syspanel/volumes/views.py b/horizon/dashboards/admin/volumes/views.py similarity index 83% rename from horizon/dashboards/syspanel/volumes/views.py rename to horizon/dashboards/admin/volumes/views.py index 1406cbd25..240deddb3 100644 --- a/horizon/dashboards/syspanel/volumes/views.py +++ b/horizon/dashboards/admin/volumes/views.py @@ -15,17 +15,17 @@ # under the License. """ -Admin views for managing Nova volumes. +Admin views for managing volumes. """ -from horizon.dashboards.nova.volumes.views import (IndexView as _IndexView, +from horizon.dashboards.project.volumes.views import (IndexView as _IndexView, DetailView as _DetailView) from .tables import VolumesTable class IndexView(_IndexView): table_class = VolumesTable - template_name = "syspanel/volumes/index.html" + template_name = "admin/volumes/index.html" def get_data(self): volumes = self._get_volumes(search_opts={'all_tenants': 1}) @@ -36,4 +36,4 @@ class IndexView(_IndexView): class DetailView(_DetailView): - template_name = "syspanel/volumes/detail.html" + template_name = "admin/volumes/detail.html" diff --git a/horizon/dashboards/nova/templates/nova/_warning.html b/horizon/dashboards/nova/templates/nova/_warning.html deleted file mode 100644 index 58171fe69..000000000 --- a/horizon/dashboards/nova/templates/nova/_warning.html +++ /dev/null @@ -1,32 +0,0 @@ -{% load i18n %} - - diff --git a/horizon/dashboards/nova/networks/subnets/__init__.py b/horizon/dashboards/project/__init__.py similarity index 100% rename from horizon/dashboards/nova/networks/subnets/__init__.py rename to horizon/dashboards/project/__init__.py diff --git a/horizon/dashboards/nova/overview/__init__.py b/horizon/dashboards/project/access_and_security/__init__.py similarity index 100% rename from horizon/dashboards/nova/overview/__init__.py rename to horizon/dashboards/project/access_and_security/__init__.py diff --git a/horizon/dashboards/nova/volumes/__init__.py b/horizon/dashboards/project/access_and_security/floating_ips/__init__.py similarity index 100% rename from horizon/dashboards/nova/volumes/__init__.py rename to horizon/dashboards/project/access_and_security/floating_ips/__init__.py diff --git a/horizon/dashboards/nova/access_and_security/floating_ips/forms.py b/horizon/dashboards/project/access_and_security/floating_ips/forms.py similarity index 100% rename from horizon/dashboards/nova/access_and_security/floating_ips/forms.py rename to horizon/dashboards/project/access_and_security/floating_ips/forms.py diff --git a/horizon/dashboards/nova/access_and_security/floating_ips/tables.py b/horizon/dashboards/project/access_and_security/floating_ips/tables.py similarity index 91% rename from horizon/dashboards/nova/access_and_security/floating_ips/tables.py rename to horizon/dashboards/project/access_and_security/floating_ips/tables.py index e032e0045..3df4ffb07 100644 --- a/horizon/dashboards/nova/access_and_security/floating_ips/tables.py +++ b/horizon/dashboards/project/access_and_security/floating_ips/tables.py @@ -35,10 +35,10 @@ class AllocateIP(tables.LinkAction): name = "allocate" verbose_name = _("Allocate IP To Project") classes = ("ajax-modal", "btn-allocate") - url = "horizon:nova:access_and_security:floating_ips:allocate" + url = "horizon:project:access_and_security:floating_ips:allocate" def single(self, data_table, request, *args): - return shortcuts.redirect('horizon:nova:access_and_security:index') + return shortcuts.redirect('horizon:project:access_and_security:index') class ReleaseIPs(tables.BatchAction): @@ -56,7 +56,7 @@ class ReleaseIPs(tables.BatchAction): class AssociateIP(tables.LinkAction): name = "associate" verbose_name = _("Associate Floating IP") - url = "horizon:nova:access_and_security:floating_ips:associate" + url = "horizon:project:access_and_security:floating_ips:associate" classes = ("ajax-modal", "btn-associate") def allowed(self, request, fip): @@ -91,7 +91,7 @@ class DisassociateIP(tables.Action): except: exceptions.handle(request, _('Unable to disassociate floating IP.')) - return shortcuts.redirect('horizon:nova:access_and_security:index') + return shortcuts.redirect('horizon:project:access_and_security:index') def get_instance_info(instance): @@ -99,7 +99,7 @@ def get_instance_info(instance): def get_instance_link(datum): - view = "horizon:nova:instances:detail" + view = "horizon:project:instances:detail" if datum.instance_id: return urlresolvers.reverse(view, args=(datum.instance_id,)) else: diff --git a/horizon/dashboards/nova/access_and_security/floating_ips/tests.py b/horizon/dashboards/project/access_and_security/floating_ips/tests.py similarity index 96% rename from horizon/dashboards/nova/access_and_security/floating_ips/tests.py rename to horizon/dashboards/project/access_and_security/floating_ips/tests.py index 0fc0c9687..762b5d414 100644 --- a/horizon/dashboards/nova/access_and_security/floating_ips/tests.py +++ b/horizon/dashboards/project/access_and_security/floating_ips/tests.py @@ -27,8 +27,8 @@ from horizon import api from horizon import test -INDEX_URL = reverse('horizon:nova:access_and_security:index') -NAMESPACE = "horizon:nova:access_and_security:floating_ips" +INDEX_URL = reverse('horizon:project:access_and_security:index') +NAMESPACE = "horizon:project:access_and_security:floating_ips" class FloatingIpViewTests(test.TestCase): @@ -44,7 +44,7 @@ class FloatingIpViewTests(test.TestCase): url = reverse('%s:associate' % NAMESPACE) res = self.client.get(url) self.assertTemplateUsed(res, - 'nova/access_and_security/floating_ips/associate.html') + 'project/access_and_security/floating_ips/associate.html') workflow = res.context['workflow'] choices = dict(workflow.steps[0].action.fields['ip_id'].choices) # Verify that our "associated" floating IP isn't in the choices list. @@ -91,7 +91,7 @@ class FloatingIpViewTests(test.TestCase): form_data = {'instance_id': server.id, 'ip_id': floating_ip.id} url = reverse('%s:associate' % NAMESPACE) - next = reverse("horizon:nova:instances:index") + next = reverse("horizon:project:instances:index") res = self.client.post("%s?next=%s" % (url, next), form_data) self.assertRedirectsNoFollow(res, next) diff --git a/horizon/dashboards/nova/access_and_security/floating_ips/urls.py b/horizon/dashboards/project/access_and_security/floating_ips/urls.py similarity index 100% rename from horizon/dashboards/nova/access_and_security/floating_ips/urls.py rename to horizon/dashboards/project/access_and_security/floating_ips/urls.py diff --git a/horizon/dashboards/nova/access_and_security/floating_ips/views.py b/horizon/dashboards/project/access_and_security/floating_ips/views.py similarity index 89% rename from horizon/dashboards/nova/access_and_security/floating_ips/views.py rename to horizon/dashboards/project/access_and_security/floating_ips/views.py index 149a16712..c379cd825 100644 --- a/horizon/dashboards/nova/access_and_security/floating_ips/views.py +++ b/horizon/dashboards/project/access_and_security/floating_ips/views.py @@ -20,7 +20,7 @@ # under the License. """ -Views for managing Nova floating IPs. +Views for managing floating IPs. """ from django.core.urlresolvers import reverse_lazy @@ -36,13 +36,13 @@ from .workflows import IPAssociationWorkflow class AssociateView(workflows.WorkflowView): workflow_class = IPAssociationWorkflow - template_name = "nova/access_and_security/floating_ips/associate.html" + template_name = "project/access_and_security/floating_ips/associate.html" class AllocateView(forms.ModalFormView): form_class = FloatingIpAllocate - template_name = 'nova/access_and_security/floating_ips/allocate.html' - success_url = reverse_lazy('horizon:nova:access_and_security:index') + template_name = 'project/access_and_security/floating_ips/allocate.html' + success_url = reverse_lazy('horizon:project:access_and_security:index') def get_object_display(self, obj): return obj.ip diff --git a/horizon/dashboards/nova/access_and_security/floating_ips/workflows.py b/horizon/dashboards/project/access_and_security/floating_ips/workflows.py similarity index 93% rename from horizon/dashboards/nova/access_and_security/floating_ips/workflows.py rename to horizon/dashboards/project/access_and_security/floating_ips/workflows.py index 58dd9895b..5d380792b 100644 --- a/horizon/dashboards/nova/access_and_security/floating_ips/workflows.py +++ b/horizon/dashboards/project/access_and_security/floating_ips/workflows.py @@ -24,7 +24,7 @@ from horizon import workflows from horizon import forms -ALLOCATE_URL = "horizon:nova:access_and_security:floating_ips:allocate" +ALLOCATE_URL = "horizon:project:access_and_security:floating_ips:allocate" class AssociateIPAction(workflows.Action): @@ -43,7 +43,7 @@ class AssociateIPAction(workflows.Action): try: ips = api.nova.tenant_floating_ip_list(self.request) except: - redirect = reverse('horizon:nova:access_and_security:index') + redirect = reverse('horizon:project:access_and_security:index') exceptions.handle(self.request, _('Unable to retrieve floating IP addresses.'), redirect=redirect) @@ -59,7 +59,7 @@ class AssociateIPAction(workflows.Action): try: servers = api.nova.server_list(self.request) except: - redirect = reverse('horizon:nova:access_and_security:index') + redirect = reverse('horizon:project:access_and_security:index') exceptions.handle(self.request, _('Unable to retrieve instance list.'), redirect=redirect) @@ -97,7 +97,7 @@ class IPAssociationWorkflow(workflows.Workflow): finalize_button_name = _("Associate") success_message = _('IP address %s associated.') failure_message = _('Unable to associate IP address %s.') - success_url = "horizon:nova:access_and_security:index" + success_url = "horizon:project:access_and_security:index" default_steps = (AssociateIP,) def format_status_message(self, message): diff --git a/horizon/dashboards/syspanel/__init__.py b/horizon/dashboards/project/access_and_security/keypairs/__init__.py similarity index 100% rename from horizon/dashboards/syspanel/__init__.py rename to horizon/dashboards/project/access_and_security/keypairs/__init__.py diff --git a/horizon/dashboards/nova/access_and_security/keypairs/forms.py b/horizon/dashboards/project/access_and_security/keypairs/forms.py similarity index 98% rename from horizon/dashboards/nova/access_and_security/keypairs/forms.py rename to horizon/dashboards/project/access_and_security/keypairs/forms.py index a71336615..561ce1719 100644 --- a/horizon/dashboards/nova/access_and_security/keypairs/forms.py +++ b/horizon/dashboards/project/access_and_security/keypairs/forms.py @@ -20,7 +20,6 @@ import re -from django import shortcuts from django.core import validators from django.utils.translation import ugettext_lazy as _ diff --git a/horizon/dashboards/nova/access_and_security/keypairs/tables.py b/horizon/dashboards/project/access_and_security/keypairs/tables.py similarity index 93% rename from horizon/dashboards/nova/access_and_security/keypairs/tables.py rename to horizon/dashboards/project/access_and_security/keypairs/tables.py index 8a9345c32..b4a4f8806 100644 --- a/horizon/dashboards/nova/access_and_security/keypairs/tables.py +++ b/horizon/dashboards/project/access_and_security/keypairs/tables.py @@ -36,14 +36,14 @@ class DeleteKeyPairs(tables.DeleteAction): class ImportKeyPair(tables.LinkAction): name = "import" verbose_name = _("Import Keypair") - url = "horizon:nova:access_and_security:keypairs:import" + url = "horizon:project:access_and_security:keypairs:import" classes = ("ajax-modal", "btn-upload") class CreateKeyPair(tables.LinkAction): name = "create" verbose_name = _("Create Keypair") - url = "horizon:nova:access_and_security:keypairs:create" + url = "horizon:project:access_and_security:keypairs:create" classes = ("ajax-modal", "btn-create") diff --git a/horizon/dashboards/nova/access_and_security/keypairs/tests.py b/horizon/dashboards/project/access_and_security/keypairs/tests.py similarity index 88% rename from horizon/dashboards/nova/access_and_security/keypairs/tests.py rename to horizon/dashboards/project/access_and_security/keypairs/tests.py index 52e58fb21..95f1a40a9 100644 --- a/horizon/dashboards/nova/access_and_security/keypairs/tests.py +++ b/horizon/dashboards/project/access_and_security/keypairs/tests.py @@ -26,7 +26,7 @@ from horizon import api from horizon import test -INDEX_VIEW_URL = reverse('horizon:nova:access_and_security:index') +INDEX_VIEW_URL = reverse('horizon:project:access_and_security:index') class KeyPairViewTests(test.TestCase): @@ -80,18 +80,18 @@ class KeyPairViewTests(test.TestCase): def test_create_keypair_get(self): res = self.client.get( - reverse('horizon:nova:access_and_security:keypairs:create')) + reverse('horizon:project:access_and_security:keypairs:create')) self.assertTemplateUsed(res, - 'nova/access_and_security/keypairs/create.html') + 'project/access_and_security/keypairs/create.html') def test_download_keypair_get(self): keypair_name = "keypair" context = {'keypair_name': keypair_name} - url = reverse('horizon:nova:access_and_security:keypairs:download', + url = reverse('horizon:project:access_and_security:keypairs:download', kwargs={'keypair_name': keypair_name}) res = self.client.get(url, context) self.assertTemplateUsed( - res, 'nova/access_and_security/keypairs/download.html') + res, 'project/access_and_security/keypairs/download.html') def test_generate_keypair_get(self): keypair = self.keypairs.first() @@ -103,7 +103,7 @@ class KeyPairViewTests(test.TestCase): self.mox.ReplayAll() context = {'keypair_name': keypair.name} - url = reverse('horizon:nova:access_and_security:keypairs:generate', + url = reverse('horizon:project:access_and_security:keypairs:generate', kwargs={'keypair_name': keypair.name}) res = self.client.get(url, context) @@ -123,7 +123,7 @@ class KeyPairViewTests(test.TestCase): formData = {'method': 'ImportKeypair', 'name': key1_name, 'public_key': public_key} - url = reverse('horizon:nova:access_and_security:keypairs:import') + url = reverse('horizon:project:access_and_security:keypairs:import') res = self.client.post(url, formData) self.assertMessageCount(res, success=1) @@ -139,7 +139,7 @@ class KeyPairViewTests(test.TestCase): formData = {'method': 'ImportKeypair', 'name': key_name, 'public_key': public_key} - url = reverse('horizon:nova:access_and_security:keypairs:import') + url = reverse('horizon:project:access_and_security:keypairs:import') res = self.client.post(url, formData, follow=True) self.assertEqual(res.redirect_chain, []) msg = 'Unable to import keypair.' @@ -154,9 +154,9 @@ class KeyPairViewTests(test.TestCase): self.mox.ReplayAll() context = {'keypair_name': keypair.name} - url = reverse('horizon:nova:access_and_security:keypairs:generate', + url = reverse('horizon:project:access_and_security:keypairs:generate', kwargs={'keypair_name': keypair.name}) res = self.client.get(url, context) self.assertRedirectsNoFollow( - res, reverse('horizon:nova:access_and_security:index')) + res, reverse('horizon:project:access_and_security:index')) diff --git a/horizon/dashboards/nova/access_and_security/keypairs/urls.py b/horizon/dashboards/project/access_and_security/keypairs/urls.py similarity index 100% rename from horizon/dashboards/nova/access_and_security/keypairs/urls.py rename to horizon/dashboards/project/access_and_security/keypairs/urls.py diff --git a/horizon/dashboards/nova/access_and_security/keypairs/views.py b/horizon/dashboards/project/access_and_security/keypairs/views.py similarity index 83% rename from horizon/dashboards/nova/access_and_security/keypairs/views.py rename to horizon/dashboards/project/access_and_security/keypairs/views.py index 72765930a..b5b7c4a8b 100644 --- a/horizon/dashboards/nova/access_and_security/keypairs/views.py +++ b/horizon/dashboards/project/access_and_security/keypairs/views.py @@ -19,7 +19,7 @@ # under the License. """ -Views for managing Nova keypairs. +Views for managing keypairs. """ import logging @@ -40,8 +40,8 @@ LOG = logging.getLogger(__name__) class CreateView(forms.ModalFormView): form_class = CreateKeypair - template_name = 'nova/access_and_security/keypairs/create.html' - success_url = 'horizon:nova:access_and_security:keypairs:download' + template_name = 'project/access_and_security/keypairs/create.html' + success_url = 'horizon:project:access_and_security:keypairs:download' def get_success_url(self): return reverse(self.success_url, @@ -50,8 +50,8 @@ class CreateView(forms.ModalFormView): class ImportView(forms.ModalFormView): form_class = ImportKeypair - template_name = 'nova/access_and_security/keypairs/import.html' - success_url = reverse_lazy('horizon:nova:access_and_security:index') + template_name = 'project/access_and_security/keypairs/import.html' + success_url = reverse_lazy('horizon:project:access_and_security:index') def get_object_id(self, keypair): return keypair.name @@ -60,7 +60,7 @@ class ImportView(forms.ModalFormView): class DownloadView(TemplateView): def get_context_data(self, keypair_name=None): return {'keypair_name': keypair_name} - template_name = 'nova/access_and_security/keypairs/download.html' + template_name = 'project/access_and_security/keypairs/download.html' class GenerateView(View): @@ -68,7 +68,7 @@ class GenerateView(View): try: keypair = api.keypair_create(request, keypair_name) except: - redirect = reverse('horizon:nova:access_and_security:index') + redirect = reverse('horizon:project:access_and_security:index') exceptions.handle(self.request, _('Unable to create keypair: %(exc)s'), redirect=redirect) diff --git a/horizon/dashboards/nova/access_and_security/panel.py b/horizon/dashboards/project/access_and_security/panel.py similarity index 90% rename from horizon/dashboards/nova/access_and_security/panel.py rename to horizon/dashboards/project/access_and_security/panel.py index 29dced17b..485e8be31 100644 --- a/horizon/dashboards/nova/access_and_security/panel.py +++ b/horizon/dashboards/project/access_and_security/panel.py @@ -18,7 +18,7 @@ from django.utils.translation import ugettext_lazy as _ import horizon -from horizon.dashboards.nova import dashboard +from horizon.dashboards.project import dashboard class AccessAndSecurity(horizon.Panel): @@ -26,4 +26,4 @@ class AccessAndSecurity(horizon.Panel): slug = 'access_and_security' -dashboard.Nova.register(AccessAndSecurity) +dashboard.Project.register(AccessAndSecurity) diff --git a/horizon/dashboards/syspanel/flavors/__init__.py b/horizon/dashboards/project/access_and_security/security_groups/__init__.py similarity index 100% rename from horizon/dashboards/syspanel/flavors/__init__.py rename to horizon/dashboards/project/access_and_security/security_groups/__init__.py diff --git a/horizon/dashboards/nova/access_and_security/security_groups/forms.py b/horizon/dashboards/project/access_and_security/security_groups/forms.py similarity index 98% rename from horizon/dashboards/nova/access_and_security/security_groups/forms.py rename to horizon/dashboards/project/access_and_security/security_groups/forms.py index 46e0b00a4..026f1d42d 100644 --- a/horizon/dashboards/nova/access_and_security/security_groups/forms.py +++ b/horizon/dashboards/project/access_and_security/security_groups/forms.py @@ -46,7 +46,7 @@ class CreateGroup(forms.SelfHandlingForm): % data['name']) return sg except: - redirect = reverse("horizon:nova:access_and_security:index") + redirect = reverse("horizon:project:access_and_security:index") exceptions.handle(request, _('Unable to create security group.'), redirect=redirect) @@ -167,7 +167,7 @@ class AddRule(forms.SelfHandlingForm): _('Successfully added rule: %s') % unicode(rule)) return rule except: - redirect = reverse("horizon:nova:access_and_security:index") + redirect = reverse("horizon:project:access_and_security:index") exceptions.handle(request, _('Unable to add rule to security group.'), redirect=redirect) diff --git a/horizon/dashboards/nova/access_and_security/security_groups/tables.py b/horizon/dashboards/project/access_and_security/security_groups/tables.py similarity index 93% rename from horizon/dashboards/nova/access_and_security/security_groups/tables.py rename to horizon/dashboards/project/access_and_security/security_groups/tables.py index d5321b29b..2a485c298 100644 --- a/horizon/dashboards/nova/access_and_security/security_groups/tables.py +++ b/horizon/dashboards/project/access_and_security/security_groups/tables.py @@ -42,14 +42,14 @@ class DeleteGroup(tables.DeleteAction): class CreateGroup(tables.LinkAction): name = "create" verbose_name = _("Create Security Group") - url = "horizon:nova:access_and_security:security_groups:create" + url = "horizon:project:access_and_security:security_groups:create" classes = ("ajax-modal", "btn-create") class EditRules(tables.LinkAction): name = "edit_rules" verbose_name = _("Edit Rules") - url = "horizon:nova:access_and_security:security_groups:edit_rules" + url = "horizon:project:access_and_security:security_groups:edit_rules" classes = ("ajax-modal", "btn-edit") @@ -75,7 +75,7 @@ class DeleteRule(tables.DeleteAction): api.security_group_rule_delete(request, obj_id) def get_success_url(self, request): - return reverse("horizon:nova:access_and_security:index") + return reverse("horizon:project:access_and_security:index") def get_source(rule): diff --git a/horizon/dashboards/nova/access_and_security/security_groups/tests.py b/horizon/dashboards/project/access_and_security/security_groups/tests.py similarity index 97% rename from horizon/dashboards/nova/access_and_security/security_groups/tests.py rename to horizon/dashboards/project/access_and_security/security_groups/tests.py index 35a464549..0d421d671 100644 --- a/horizon/dashboards/nova/access_and_security/security_groups/tests.py +++ b/horizon/dashboards/project/access_and_security/security_groups/tests.py @@ -28,9 +28,9 @@ from horizon import api from horizon import test from .tables import SecurityGroupsTable, RulesTable -INDEX_URL = reverse('horizon:nova:access_and_security:index') -SG_CREATE_URL = \ - reverse('horizon:nova:access_and_security:security_groups:create') +INDEX_URL = reverse('horizon:project:access_and_security:index') +SG_CREATE_URL = reverse('horizon:project:access_and_security:' + 'security_groups:create') def strip_absolute_base(uri): @@ -41,14 +41,14 @@ class SecurityGroupsViewTests(test.TestCase): def setUp(self): super(SecurityGroupsViewTests, self).setUp() sec_group = self.security_groups.first() - self.edit_url = reverse('horizon:nova:access_and_security:' + self.edit_url = reverse('horizon:project:access_and_security:' 'security_groups:edit_rules', args=[sec_group.id]) def test_create_security_groups_get(self): res = self.client.get(SG_CREATE_URL) self.assertTemplateUsed(res, - 'nova/access_and_security/security_groups/create.html') + 'project/access_and_security/security_groups/create.html') def test_create_security_groups_post(self): sec_group = self.security_groups.first() @@ -94,7 +94,7 @@ class SecurityGroupsViewTests(test.TestCase): res = self.client.get(self.edit_url) self.assertTemplateUsed(res, - 'nova/access_and_security/security_groups/edit_rules.html') + 'project/access_and_security/security_groups/edit_rules.html') self.assertItemsEqual(res.context['security_group'].name, sec_group.name) diff --git a/horizon/dashboards/nova/access_and_security/security_groups/urls.py b/horizon/dashboards/project/access_and_security/security_groups/urls.py similarity index 100% rename from horizon/dashboards/nova/access_and_security/security_groups/urls.py rename to horizon/dashboards/project/access_and_security/security_groups/urls.py diff --git a/horizon/dashboards/nova/access_and_security/security_groups/views.py b/horizon/dashboards/project/access_and_security/security_groups/views.py similarity index 91% rename from horizon/dashboards/nova/access_and_security/security_groups/views.py rename to horizon/dashboards/project/access_and_security/security_groups/views.py index 48aaf608b..5102db4a6 100644 --- a/horizon/dashboards/nova/access_and_security/security_groups/views.py +++ b/horizon/dashboards/project/access_and_security/security_groups/views.py @@ -19,7 +19,7 @@ # under the License. """ -Views for managing Nova instances. +Views for managing instances. """ import logging @@ -41,8 +41,9 @@ LOG = logging.getLogger(__name__) class EditRulesView(tables.DataTableView, forms.ModalFormView): table_class = RulesTable form_class = AddRule - template_name = 'nova/access_and_security/security_groups/edit_rules.html' - success_url = reverse_lazy("horizon:nova:access_and_security:index") + template_name = ('project/access_and_security/security_groups/' + 'edit_rules.html') + success_url = reverse_lazy("horizon:project:access_and_security:index") def get_data(self): security_group_id = int(self.kwargs['security_group_id']) @@ -115,5 +116,5 @@ class EditRulesView(tables.DataTableView, forms.ModalFormView): class CreateView(forms.ModalFormView): form_class = CreateGroup - template_name = 'nova/access_and_security/security_groups/create.html' - success_url = reverse_lazy('horizon:nova:access_and_security:index') + template_name = 'project/access_and_security/security_groups/create.html' + success_url = reverse_lazy('horizon:project:access_and_security:index') diff --git a/horizon/dashboards/nova/access_and_security/templates/access_and_security/floating_ips/_allocate.html b/horizon/dashboards/project/access_and_security/templates/access_and_security/floating_ips/_allocate.html similarity index 83% rename from horizon/dashboards/nova/access_and_security/templates/access_and_security/floating_ips/_allocate.html rename to horizon/dashboards/project/access_and_security/templates/access_and_security/floating_ips/_allocate.html index a68a4ddc5..abc7e18df 100644 --- a/horizon/dashboards/nova/access_and_security/templates/access_and_security/floating_ips/_allocate.html +++ b/horizon/dashboards/project/access_and_security/templates/access_and_security/floating_ips/_allocate.html @@ -3,7 +3,7 @@ {% load horizon i18n %} {% block form_id %}associate_floating_ip_form{% endblock %} -{% block form_action %}{% url horizon:nova:access_and_security:floating_ips:allocate %}{% endblock %} +{% block form_action %}{% url horizon:project:access_and_security:floating_ips:allocate %}{% endblock %} {% block modal-header %}{% trans "Allocate Floating IP" %}{% endblock %} @@ -29,5 +29,5 @@ {% block modal-footer %} - {% trans "Cancel" %} + {% trans "Cancel" %} {% endblock %} diff --git a/horizon/dashboards/nova/access_and_security/templates/access_and_security/floating_ips/allocate.html b/horizon/dashboards/project/access_and_security/templates/access_and_security/floating_ips/allocate.html similarity index 65% rename from horizon/dashboards/nova/access_and_security/templates/access_and_security/floating_ips/allocate.html rename to horizon/dashboards/project/access_and_security/templates/access_and_security/floating_ips/allocate.html index 2d59fd3d7..8679b9e8f 100644 --- a/horizon/dashboards/nova/access_and_security/templates/access_and_security/floating_ips/allocate.html +++ b/horizon/dashboards/project/access_and_security/templates/access_and_security/floating_ips/allocate.html @@ -3,5 +3,5 @@ {% block title %}{% trans "Allocate Floating IP" %}{% endblock %} {% block main %} - {% include 'nova/access_and_security/floating_ips/_allocate.html' %} + {% include 'project/access_and_security/floating_ips/_allocate.html' %} {% endblock %} diff --git a/horizon/dashboards/nova/access_and_security/templates/access_and_security/floating_ips/associate.html b/horizon/dashboards/project/access_and_security/templates/access_and_security/floating_ips/associate.html similarity index 100% rename from horizon/dashboards/nova/access_and_security/templates/access_and_security/floating_ips/associate.html rename to horizon/dashboards/project/access_and_security/templates/access_and_security/floating_ips/associate.html diff --git a/horizon/dashboards/nova/access_and_security/templates/access_and_security/index.html b/horizon/dashboards/project/access_and_security/templates/access_and_security/index.html similarity index 100% rename from horizon/dashboards/nova/access_and_security/templates/access_and_security/index.html rename to horizon/dashboards/project/access_and_security/templates/access_and_security/index.html diff --git a/horizon/dashboards/nova/access_and_security/templates/access_and_security/keypairs/_create.html b/horizon/dashboards/project/access_and_security/templates/access_and_security/keypairs/_create.html similarity index 78% rename from horizon/dashboards/nova/access_and_security/templates/access_and_security/keypairs/_create.html rename to horizon/dashboards/project/access_and_security/templates/access_and_security/keypairs/_create.html index f8ad58760..db9ee8d39 100644 --- a/horizon/dashboards/nova/access_and_security/templates/access_and_security/keypairs/_create.html +++ b/horizon/dashboards/project/access_and_security/templates/access_and_security/keypairs/_create.html @@ -2,7 +2,7 @@ {% load i18n %} {% block form_id %}create_keypair_form{% endblock %} -{% block form_action %}{% url horizon:nova:access_and_security:keypairs:create %}{% endblock %} +{% block form_action %}{% url horizon:project:access_and_security:keypairs:create %}{% endblock %} {% block modal-header %}{% trans "Create Keypair" %}{% endblock %} @@ -21,5 +21,5 @@ {% block modal-footer %} - {% trans "Cancel" %} + {% trans "Cancel" %} {% endblock %} diff --git a/horizon/dashboards/nova/access_and_security/templates/access_and_security/keypairs/_import.html b/horizon/dashboards/project/access_and_security/templates/access_and_security/keypairs/_import.html similarity index 78% rename from horizon/dashboards/nova/access_and_security/templates/access_and_security/keypairs/_import.html rename to horizon/dashboards/project/access_and_security/templates/access_and_security/keypairs/_import.html index 877087502..2eca705b7 100644 --- a/horizon/dashboards/nova/access_and_security/templates/access_and_security/keypairs/_import.html +++ b/horizon/dashboards/project/access_and_security/templates/access_and_security/keypairs/_import.html @@ -2,7 +2,7 @@ {% load i18n %} {% block form_id %}import_keypair_form{% endblock %} -{% block form_action %}{% url horizon:nova:access_and_security:keypairs:import %}{% endblock %} +{% block form_action %}{% url horizon:project:access_and_security:keypairs:import %}{% endblock %} {% block modal-header %}{% trans "Import Keypair" %}{% endblock %} @@ -21,5 +21,5 @@ {% block modal-footer %} - {% trans "Cancel" %} + {% trans "Cancel" %} {% endblock %} diff --git a/horizon/dashboards/nova/access_and_security/templates/access_and_security/keypairs/create.html b/horizon/dashboards/project/access_and_security/templates/access_and_security/keypairs/create.html similarity index 79% rename from horizon/dashboards/nova/access_and_security/templates/access_and_security/keypairs/create.html rename to horizon/dashboards/project/access_and_security/templates/access_and_security/keypairs/create.html index b483a451b..4f98bb1f1 100644 --- a/horizon/dashboards/nova/access_and_security/templates/access_and_security/keypairs/create.html +++ b/horizon/dashboards/project/access_and_security/templates/access_and_security/keypairs/create.html @@ -7,6 +7,6 @@ {% endblock page_header %} {% block main %} - {% include 'nova/access_and_security/keypairs/_create.html' %} + {% include 'project/access_and_security/keypairs/_create.html' %} {% endblock %} diff --git a/horizon/dashboards/nova/access_and_security/templates/access_and_security/keypairs/download.html b/horizon/dashboards/project/access_and_security/templates/access_and_security/keypairs/download.html similarity index 77% rename from horizon/dashboards/nova/access_and_security/templates/access_and_security/keypairs/download.html rename to horizon/dashboards/project/access_and_security/templates/access_and_security/keypairs/download.html index 669d2bd39..3cc9de587 100644 --- a/horizon/dashboards/nova/access_and_security/templates/access_and_security/keypairs/download.html +++ b/horizon/dashboards/project/access_and_security/templates/access_and_security/keypairs/download.html @@ -11,11 +11,11 @@

{% blocktrans %}The keypair "{{ keypair_name }}" should download automatically. If not use the link below.{% endblocktrans %}

{% endblock %} diff --git a/horizon/dashboards/nova/access_and_security/templates/access_and_security/keypairs/import.html b/horizon/dashboards/project/access_and_security/templates/access_and_security/keypairs/import.html similarity index 79% rename from horizon/dashboards/nova/access_and_security/templates/access_and_security/keypairs/import.html rename to horizon/dashboards/project/access_and_security/templates/access_and_security/keypairs/import.html index e44382f3a..7a9199bfc 100644 --- a/horizon/dashboards/nova/access_and_security/templates/access_and_security/keypairs/import.html +++ b/horizon/dashboards/project/access_and_security/templates/access_and_security/keypairs/import.html @@ -7,6 +7,6 @@ {% endblock page_header %} {% block main %} - {% include 'nova/access_and_security/keypairs/_import.html' %} + {% include 'project/access_and_security/keypairs/_import.html' %} {% endblock %} diff --git a/horizon/dashboards/nova/access_and_security/templates/access_and_security/security_groups/_create.html b/horizon/dashboards/project/access_and_security/templates/access_and_security/security_groups/_create.html similarity index 75% rename from horizon/dashboards/nova/access_and_security/templates/access_and_security/security_groups/_create.html rename to horizon/dashboards/project/access_and_security/templates/access_and_security/security_groups/_create.html index bf4857f77..2c8eed7e1 100644 --- a/horizon/dashboards/nova/access_and_security/templates/access_and_security/security_groups/_create.html +++ b/horizon/dashboards/project/access_and_security/templates/access_and_security/security_groups/_create.html @@ -2,7 +2,7 @@ {% load i18n %} {% block form_id %}create_security_group_form{% endblock %} -{% block form_action %}{% url horizon:nova:access_and_security:security_groups:create %}{% endblock %} +{% block form_action %}{% url horizon:project:access_and_security:security_groups:create %}{% endblock %} {% block modal-header %}{% trans "Create Security Group" %}{% endblock %} {% block modal_id %}create_security_group_modal{% endblock %} @@ -21,5 +21,5 @@ {% block modal-footer %} - {% trans "Cancel" %} + {% trans "Cancel" %} {% endblock %} diff --git a/horizon/dashboards/nova/access_and_security/templates/access_and_security/security_groups/_edit_rules.html b/horizon/dashboards/project/access_and_security/templates/access_and_security/security_groups/_edit_rules.html similarity index 71% rename from horizon/dashboards/nova/access_and_security/templates/access_and_security/security_groups/_edit_rules.html rename to horizon/dashboards/project/access_and_security/templates/access_and_security/security_groups/_edit_rules.html index a1e07ffdd..fa51e74f0 100644 --- a/horizon/dashboards/nova/access_and_security/templates/access_and_security/security_groups/_edit_rules.html +++ b/horizon/dashboards/project/access_and_security/templates/access_and_security/security_groups/_edit_rules.html @@ -2,7 +2,7 @@ {% load i18n %} {% block form_id %}security_group_rule_form{% endblock %} -{% block form_action %}{% url horizon:nova:access_and_security:security_groups:edit_rules security_group.id %}{% endblock %} +{% block form_action %}{% url horizon:project:access_and_security:security_groups:edit_rules security_group.id %}{% endblock %} {% block form_class %}{{ block.super }} horizontal split_five{% endblock %} {% block modal_id %}security_group_rule_modal{% endblock %} @@ -17,5 +17,5 @@ {% block modal-footer %} - {% trans "Cancel" %} + {% trans "Cancel" %} {% endblock %} diff --git a/horizon/dashboards/nova/access_and_security/templates/access_and_security/security_groups/create.html b/horizon/dashboards/project/access_and_security/templates/access_and_security/security_groups/create.html similarity index 77% rename from horizon/dashboards/nova/access_and_security/templates/access_and_security/security_groups/create.html rename to horizon/dashboards/project/access_and_security/templates/access_and_security/security_groups/create.html index afdfa6049..cd102ab47 100644 --- a/horizon/dashboards/nova/access_and_security/templates/access_and_security/security_groups/create.html +++ b/horizon/dashboards/project/access_and_security/templates/access_and_security/security_groups/create.html @@ -7,5 +7,5 @@ {% endblock page_header %} {% block main %} - {% include 'nova/access_and_security/security_groups/_create.html' %} + {% include 'project/access_and_security/security_groups/_create.html' %} {% endblock %} diff --git a/horizon/dashboards/nova/access_and_security/templates/access_and_security/security_groups/edit_rules.html b/horizon/dashboards/project/access_and_security/templates/access_and_security/security_groups/edit_rules.html similarity index 77% rename from horizon/dashboards/nova/access_and_security/templates/access_and_security/security_groups/edit_rules.html rename to horizon/dashboards/project/access_and_security/templates/access_and_security/security_groups/edit_rules.html index 94aac4fb2..4afe3f704 100644 --- a/horizon/dashboards/nova/access_and_security/templates/access_and_security/security_groups/edit_rules.html +++ b/horizon/dashboards/project/access_and_security/templates/access_and_security/security_groups/edit_rules.html @@ -7,5 +7,5 @@ {% endblock page_header %} {% block main %} - {% include "nova/access_and_security/security_groups/_edit_rules.html" %} + {% include "project/access_and_security/security_groups/_edit_rules.html" %} {% endblock %} diff --git a/horizon/dashboards/nova/access_and_security/tests.py b/horizon/dashboards/project/access_and_security/tests.py similarity index 90% rename from horizon/dashboards/nova/access_and_security/tests.py rename to horizon/dashboards/project/access_and_security/tests.py index 15721fdaa..a39796827 100644 --- a/horizon/dashboards/nova/access_and_security/tests.py +++ b/horizon/dashboards/project/access_and_security/tests.py @@ -46,10 +46,10 @@ class AccessAndSecurityTests(test.TestCase): self.mox.ReplayAll() - res = self.client.get( - reverse('horizon:nova:access_and_security:index')) + url = reverse('horizon:project:access_and_security:index') + res = self.client.get(url) - self.assertTemplateUsed(res, 'nova/access_and_security/index.html') + self.assertTemplateUsed(res, 'project/access_and_security/index.html') self.assertItemsEqual(res.context['keypairs_table'].data, keypairs) self.assertItemsEqual(res.context['security_groups_table'].data, sec_groups) @@ -74,10 +74,10 @@ class AccessAndSecurityTests(test.TestCase): api.nova.server_list(IsA(http.HttpRequest)).AndReturn(servers) self.mox.ReplayAll() - res = self.client.get(reverse("horizon:nova:access_and_security:" + res = self.client.get(reverse("horizon:project:access_and_security:" "floating_ips:associate")) self.assertTemplateUsed(res, - 'nova/access_and_security/floating_ips/associate.html') + 'project/access_and_security/floating_ips/associate.html') self.assertContains(res, '') diff --git a/horizon/dashboards/nova/access_and_security/urls.py b/horizon/dashboards/project/access_and_security/urls.py similarity index 100% rename from horizon/dashboards/nova/access_and_security/urls.py rename to horizon/dashboards/project/access_and_security/urls.py diff --git a/horizon/dashboards/nova/access_and_security/views.py b/horizon/dashboards/project/access_and_security/views.py similarity index 97% rename from horizon/dashboards/nova/access_and_security/views.py rename to horizon/dashboards/project/access_and_security/views.py index 83d2328d6..a4e6576ba 100644 --- a/horizon/dashboards/nova/access_and_security/views.py +++ b/horizon/dashboards/project/access_and_security/views.py @@ -39,7 +39,7 @@ LOG = logging.getLogger(__name__) class IndexView(tables.MultiTableView): table_classes = (KeypairsTable, SecurityGroupsTable, FloatingIPsTable) - template_name = 'nova/access_and_security/index.html' + template_name = 'project/access_and_security/index.html' def get_keypairs_data(self): try: diff --git a/horizon/dashboards/syspanel/images/__init__.py b/horizon/dashboards/project/containers/__init__.py similarity index 100% rename from horizon/dashboards/syspanel/images/__init__.py rename to horizon/dashboards/project/containers/__init__.py diff --git a/horizon/dashboards/nova/containers/browsers.py b/horizon/dashboards/project/containers/browsers.py similarity index 95% rename from horizon/dashboards/nova/containers/browsers.py rename to horizon/dashboards/project/containers/browsers.py index bb8de593a..3030cc2fb 100644 --- a/horizon/dashboards/nova/containers/browsers.py +++ b/horizon/dashboards/project/containers/browsers.py @@ -34,4 +34,4 @@ class ContainerBrowser(browsers.ResourceBrowser): navigation_kwarg_name = "container_name" content_kwarg_name = "subfolder_path" has_breadcrumb = True - breadcrumb_url = "horizon:nova:containers:index" + breadcrumb_url = "horizon:project:containers:index" diff --git a/horizon/dashboards/nova/containers/forms.py b/horizon/dashboards/project/containers/forms.py similarity index 99% rename from horizon/dashboards/nova/containers/forms.py rename to horizon/dashboards/project/containers/forms.py index 82a493625..283bf79d2 100644 --- a/horizon/dashboards/nova/containers/forms.py +++ b/horizon/dashboards/project/containers/forms.py @@ -114,7 +114,7 @@ class CopyObject(forms.SelfHandlingForm): self.fields['new_container_name'].choices = containers def handle(self, request, data): - index = "horizon:nova:containers:index" + index = "horizon:project:containers:index" orig_container = data['orig_container_name'] orig_object = data['orig_object_name'] new_container = data['new_container_name'] diff --git a/horizon/dashboards/nova/containers/panel.py b/horizon/dashboards/project/containers/panel.py similarity index 92% rename from horizon/dashboards/nova/containers/panel.py rename to horizon/dashboards/project/containers/panel.py index aa06f7270..5abca538e 100644 --- a/horizon/dashboards/nova/containers/panel.py +++ b/horizon/dashboards/project/containers/panel.py @@ -21,7 +21,7 @@ from django.utils.translation import ugettext_lazy as _ import horizon -from horizon.dashboards.nova import dashboard +from horizon.dashboards.project import dashboard class Containers(horizon.Panel): @@ -29,4 +29,4 @@ class Containers(horizon.Panel): slug = 'containers' permissions = ('openstack.services.object-store',) -dashboard.Nova.register(Containers) +dashboard.Project.register(Containers) diff --git a/horizon/dashboards/nova/containers/tables.py b/horizon/dashboards/project/containers/tables.py similarity index 94% rename from horizon/dashboards/nova/containers/tables.py rename to horizon/dashboards/project/containers/tables.py index b767e12a5..e42ebeade 100644 --- a/horizon/dashboards/nova/containers/tables.py +++ b/horizon/dashboards/project/containers/tables.py @@ -38,7 +38,7 @@ def wrap_delimiter(name): class DeleteContainer(tables.DeleteAction): data_type_singular = _("Container") data_type_plural = _("Containers") - success_url = "horizon:nova:containers:index" + success_url = "horizon:project:containers:index" def delete(self, request, obj_id): api.swift_delete_container(request, obj_id) @@ -59,14 +59,14 @@ class DeleteContainer(tables.DeleteAction): class CreateContainer(tables.LinkAction): name = "create" verbose_name = _("Create Container") - url = "horizon:nova:containers:create" + url = "horizon:project:containers:create" classes = ("ajax-modal", "btn-create") class ListObjects(tables.LinkAction): name = "list_objects" verbose_name = _("View Container") - url = "horizon:nova:containers:index" + url = "horizon:project:containers:index" classes = ("btn-list",) def get_link_url(self, datum=None): @@ -78,7 +78,7 @@ class ListObjects(tables.LinkAction): class UploadObject(tables.LinkAction): name = "upload" verbose_name = _("Upload Object") - url = "horizon:nova:containers:object_upload" + url = "horizon:project:containers:object_upload" classes = ("ajax-modal", "btn-upload") def get_link_url(self, datum=None): @@ -110,7 +110,7 @@ def get_size_used(container): def get_container_link(container): - return reverse("horizon:nova:containers:index", + return reverse("horizon:project:containers:index", args=(http.urlquote(wrap_delimiter(container.name)),)) @@ -160,7 +160,7 @@ class DeleteMultipleObjects(DeleteObject): class CopyObject(tables.LinkAction): name = "copy" verbose_name = _("Copy") - url = "horizon:nova:containers:object_copy" + url = "horizon:project:containers:object_copy" classes = ("ajax-modal", "btn-copy") allowed_data_types = ("objects",) @@ -173,7 +173,7 @@ class CopyObject(tables.LinkAction): class DownloadObject(tables.LinkAction): name = "download" verbose_name = _("Download") - url = "horizon:nova:containers:object_download" + url = "horizon:project:containers:object_download" classes = ("btn-download",) allowed_data_types = ("objects",) @@ -222,14 +222,14 @@ def get_size(obj): def get_link_subfolder(subfolder): container_name = subfolder.container_name - return reverse("horizon:nova:containers:index", + return reverse("horizon:project:containers:index", args=(http.urlquote(wrap_delimiter(container_name)), http.urlquote(wrap_delimiter(subfolder.name)))) class CreateSubfolder(CreateContainer): verbose_name = _("Create Folder") - url = "horizon:nova:containers:create" + url = "horizon:project:containers:create" def get_link_url(self): container = self.table.kwargs['container_name'] diff --git a/horizon/dashboards/nova/containers/templates/containers/_copy.html b/horizon/dashboards/project/containers/templates/containers/_copy.html similarity index 74% rename from horizon/dashboards/nova/containers/templates/containers/_copy.html rename to horizon/dashboards/project/containers/templates/containers/_copy.html index aef4431d0..3266a7bd8 100644 --- a/horizon/dashboards/nova/containers/templates/containers/_copy.html +++ b/horizon/dashboards/project/containers/templates/containers/_copy.html @@ -2,7 +2,7 @@ {% load i18n %} {% block form_id %}copy_object_form{% endblock %} -{% block form_action %}{% url horizon:nova:containers:object_copy container_name object_name %}{% endblock %} +{% block form_action %}{% url horizon:project:containers:object_copy container_name object_name %}{% endblock %} {% block modal-header %}{% trans "Copy Object" %}: {{ object_name }}{% endblock %} @@ -20,5 +20,5 @@ {% block modal-footer %} - {% trans "Cancel" %} + {% trans "Cancel" %} {% endblock %} diff --git a/horizon/dashboards/nova/containers/templates/containers/_create.html b/horizon/dashboards/project/containers/templates/containers/_create.html similarity index 84% rename from horizon/dashboards/nova/containers/templates/containers/_create.html rename to horizon/dashboards/project/containers/templates/containers/_create.html index 9893fd027..4b1e04195 100644 --- a/horizon/dashboards/nova/containers/templates/containers/_create.html +++ b/horizon/dashboards/project/containers/templates/containers/_create.html @@ -2,7 +2,7 @@ {% load i18n %} {% block form_id %}create_container_form{% endblock %} -{% block form_action %}{% url horizon:nova:containers:create %}{% endblock %} +{% block form_action %}{% url horizon:project:containers:create %}{% endblock %} {% block modal-header %}{% trans "Create Container" %}{% endblock %} @@ -20,5 +20,5 @@ {% block modal-footer %} - {% trans "Cancel" %} + {% trans "Cancel" %} {% endblock %} diff --git a/horizon/dashboards/nova/containers/templates/containers/_upload.html b/horizon/dashboards/project/containers/templates/containers/_upload.html similarity index 80% rename from horizon/dashboards/nova/containers/templates/containers/_upload.html rename to horizon/dashboards/project/containers/templates/containers/_upload.html index fd8385714..503bc9778 100644 --- a/horizon/dashboards/nova/containers/templates/containers/_upload.html +++ b/horizon/dashboards/project/containers/templates/containers/_upload.html @@ -2,7 +2,7 @@ {% load i18n %} {% block form_id %}upload_object_form{% endblock %} -{% block form_action %}{% url horizon:nova:containers:object_upload container_name %}{% endblock %} +{% block form_action %}{% url horizon:project:containers:object_upload container_name %}{% endblock %} {% block form_attrs %}enctype="multipart/form-data"{% endblock %} {% block modal-header %}{% trans "Upload Object To Container" %}: {{ container_name }}{% endblock %} @@ -21,5 +21,5 @@ {% block modal-footer %} - {% trans "Cancel" %} + {% trans "Cancel" %} {% endblock %} diff --git a/horizon/dashboards/nova/containers/templates/containers/copy.html b/horizon/dashboards/project/containers/templates/containers/copy.html similarity index 84% rename from horizon/dashboards/nova/containers/templates/containers/copy.html rename to horizon/dashboards/project/containers/templates/containers/copy.html index 26465a29c..d3568a496 100644 --- a/horizon/dashboards/nova/containers/templates/containers/copy.html +++ b/horizon/dashboards/project/containers/templates/containers/copy.html @@ -7,7 +7,7 @@ {% endblock page_header %} {% block main %} - {% include 'nova/containers/_copy.html' %} + {% include 'project/containers/_copy.html' %} {% endblock %} diff --git a/horizon/dashboards/nova/containers/templates/containers/create.html b/horizon/dashboards/project/containers/templates/containers/create.html similarity index 83% rename from horizon/dashboards/nova/containers/templates/containers/create.html rename to horizon/dashboards/project/containers/templates/containers/create.html index cf5d85396..bba31fccb 100644 --- a/horizon/dashboards/nova/containers/templates/containers/create.html +++ b/horizon/dashboards/project/containers/templates/containers/create.html @@ -7,5 +7,5 @@ {% endblock page_header %} {% block main %} - {% include "nova/containers/_create.html" %} + {% include "project/containers/_create.html" %} {% endblock %} diff --git a/horizon/dashboards/nova/containers/templates/containers/index.html b/horizon/dashboards/project/containers/templates/containers/index.html similarity index 100% rename from horizon/dashboards/nova/containers/templates/containers/index.html rename to horizon/dashboards/project/containers/templates/containers/index.html diff --git a/horizon/dashboards/nova/containers/templates/containers/upload.html b/horizon/dashboards/project/containers/templates/containers/upload.html similarity index 83% rename from horizon/dashboards/nova/containers/templates/containers/upload.html rename to horizon/dashboards/project/containers/templates/containers/upload.html index ade2e2661..4f8838172 100644 --- a/horizon/dashboards/nova/containers/templates/containers/upload.html +++ b/horizon/dashboards/project/containers/templates/containers/upload.html @@ -7,7 +7,7 @@ {% endblock page_header %} {% block main %} - {% include 'nova/containers/_upload.html' %} + {% include 'project/containers/_upload.html' %} {% endblock %} diff --git a/horizon/dashboards/nova/containers/tests.py b/horizon/dashboards/project/containers/tests.py similarity index 88% rename from horizon/dashboards/nova/containers/tests.py rename to horizon/dashboards/project/containers/tests.py index e3f67af4d..095225c13 100644 --- a/horizon/dashboards/nova/containers/tests.py +++ b/horizon/dashboards/project/containers/tests.py @@ -31,7 +31,7 @@ from .tables import ContainersTable, ObjectsTable, wrap_delimiter from . import forms -CONTAINER_INDEX_URL = reverse('horizon:nova:containers:index') +CONTAINER_INDEX_URL = reverse('horizon:project:containers:index') class SwiftTests(test.TestCase): @@ -44,7 +44,7 @@ class SwiftTests(test.TestCase): res = self.client.get(CONTAINER_INDEX_URL) - self.assertTemplateUsed(res, 'nova/containers/index.html') + self.assertTemplateUsed(res, 'project/containers/index.html') self.assertIn('table', res.context) resp_containers = res.context['table'].data self.assertEqual(len(resp_containers), len(containers)) @@ -79,8 +79,8 @@ class SwiftTests(test.TestCase): self.assertEqual(handled['location'], CONTAINER_INDEX_URL) def test_create_container_get(self): - res = self.client.get(reverse('horizon:nova:containers:create')) - self.assertTemplateUsed(res, 'nova/containers/create.html') + res = self.client.get(reverse('horizon:project:containers:create')) + self.assertTemplateUsed(res, 'project/containers/create.html') def test_create_container_post(self): self.mox.StubOutWithMock(api, 'swift_create_container') @@ -90,9 +90,9 @@ class SwiftTests(test.TestCase): formData = {'name': self.containers.first().name, 'method': forms.CreateContainer.__name__} - res = self.client.post(reverse('horizon:nova:containers:create'), + res = self.client.post(reverse('horizon:project:containers:create'), formData) - url = reverse('horizon:nova:containers:index', + url = reverse('horizon:project:containers:index', args=[wrap_delimiter(self.containers.first().name)]) self.assertRedirectsNoFollow(res, url) @@ -109,11 +109,11 @@ class SwiftTests(test.TestCase): prefix=None).AndReturn(ret) self.mox.ReplayAll() - res = self.client.get(reverse('horizon:nova:containers:index', + res = self.client.get(reverse('horizon:project:containers:index', args=[wrap_delimiter(self.containers .first() .name)])) - self.assertTemplateUsed(res, 'nova/containers/index.html') + self.assertTemplateUsed(res, 'project/containers/index.html') # UTF8 encoding here to ensure there aren't problems with Nose output. expected = [obj.name.encode('utf8') for obj in self.objects.list()] self.assertQuerysetEqual(res.context['objects_table'].data, @@ -137,11 +137,11 @@ class SwiftTests(test.TestCase): IsA(InMemoryUploadedFile)).AndReturn(obj) self.mox.ReplayAll() - upload_url = reverse('horizon:nova:containers:object_upload', + upload_url = reverse('horizon:project:containers:object_upload', args=[container.name]) res = self.client.get(upload_url) - self.assertTemplateUsed(res, 'nova/containers/upload.html') + self.assertTemplateUsed(res, 'project/containers/upload.html') res = self.client.get(upload_url) self.assertContains(res, 'enctype="multipart/form-data"') @@ -152,7 +152,7 @@ class SwiftTests(test.TestCase): 'object_file': temp_file} res = self.client.post(upload_url, formData) - index_url = reverse('horizon:nova:containers:index', + index_url = reverse('horizon:project:containers:index', args=[wrap_delimiter(container.name)]) self.assertRedirectsNoFollow(res, index_url) @@ -165,7 +165,7 @@ class SwiftTests(test.TestCase): def test_delete(self): container = self.containers.first() obj = self.objects.first() - index_url = reverse('horizon:nova:containers:index', + index_url = reverse('horizon:project:containers:index', args=[wrap_delimiter(container.name)]) self.mox.StubOutWithMock(api, 'swift_delete_object') api.swift_delete_object(IsA(http.HttpRequest), @@ -191,7 +191,7 @@ class SwiftTests(test.TestCase): obj.name).AndReturn(obj) self.mox.ReplayAll() - download_url = reverse('horizon:nova:containers:object_download', + download_url = reverse('horizon:project:containers:object_download', args=[container.name, obj.name]) res = self.client.get(download_url) self.assertEqual(res.content, obj.data) @@ -203,10 +203,10 @@ class SwiftTests(test.TestCase): api.swift_get_containers(IsA(http.HttpRequest)).AndReturn(ret) self.mox.ReplayAll() - res = self.client.get(reverse('horizon:nova:containers:object_copy', + res = self.client.get(reverse('horizon:project:containers:object_copy', args=[self.containers.first().name, self.objects.first().name])) - self.assertTemplateUsed(res, 'nova/containers/copy.html') + self.assertTemplateUsed(res, 'project/containers/copy.html') def test_copy(self): container_1 = self.containers.get(name=u"container_one\u6346") @@ -229,9 +229,9 @@ class SwiftTests(test.TestCase): 'new_object_name': obj.name, 'orig_container_name': container_1.name, 'orig_object_name': obj.name} - copy_url = reverse('horizon:nova:containers:object_copy', + copy_url = reverse('horizon:project:containers:object_copy', args=[container_1.name, obj.name]) res = self.client.post(copy_url, formData) - index_url = reverse('horizon:nova:containers:index', + index_url = reverse('horizon:project:containers:index', args=[wrap_delimiter(container_2.name)]) self.assertRedirectsNoFollow(res, index_url) diff --git a/horizon/dashboards/nova/containers/urls.py b/horizon/dashboards/project/containers/urls.py similarity index 95% rename from horizon/dashboards/nova/containers/urls.py rename to horizon/dashboards/project/containers/urls.py index 363b19c72..8ea63260f 100644 --- a/horizon/dashboards/nova/containers/urls.py +++ b/horizon/dashboards/project/containers/urls.py @@ -24,7 +24,7 @@ from .views import CreateView, UploadView, CopyView, ContainerView # Swift containers and objects. -urlpatterns = patterns('horizon.dashboards.nova.containers.views', +urlpatterns = patterns('horizon.dashboards.project.containers.views', url(r'^((?P.+?)/)?(?P(.+/)+)?$', ContainerView.as_view(), name='index'), diff --git a/horizon/dashboards/nova/containers/views.py b/horizon/dashboards/project/containers/views.py similarity index 94% rename from horizon/dashboards/nova/containers/views.py rename to horizon/dashboards/project/containers/views.py index d262cec31..b8cedc8e3 100644 --- a/horizon/dashboards/nova/containers/views.py +++ b/horizon/dashboards/project/containers/views.py @@ -39,7 +39,7 @@ from .tables import wrap_delimiter class ContainerView(browsers.ResourceBrowserView): browser_class = ContainerBrowser - template_name = "nova/containers/index.html" + template_name = "project/containers/index.html" def get_containers_data(self): containers = [] @@ -114,8 +114,8 @@ class ContainerView(browsers.ResourceBrowserView): class CreateView(forms.ModalFormView): form_class = CreateContainer - template_name = 'nova/containers/create.html' - success_url = "horizon:nova:containers:index" + template_name = 'project/containers/create.html' + success_url = "horizon:project:containers:index" def get_success_url(self): parent = self.request.POST.get('parent', None) @@ -137,8 +137,8 @@ class CreateView(forms.ModalFormView): class UploadView(forms.ModalFormView): form_class = UploadObject - template_name = 'nova/containers/upload.html' - success_url = "horizon:nova:containers:index" + template_name = 'project/containers/upload.html' + success_url = "horizon:project:containers:index" def get_success_url(self): container_name = self.request.POST['container_name'] @@ -160,7 +160,7 @@ def object_download(request, container_name, object_path): try: obj = api.swift.swift_get_object(request, container_name, object_path) except: - redirect = reverse("horizon:nova:containers:index") + redirect = reverse("horizon:project:containers:index") exceptions.handle(request, _("Unable to retrieve object."), redirect=redirect) @@ -180,8 +180,8 @@ def object_download(request, container_name, object_path): class CopyView(forms.ModalFormView): form_class = CopyObject - template_name = 'nova/containers/copy.html' - success_url = "horizon:nova:containers:index" + template_name = 'project/containers/copy.html' + success_url = "horizon:project:containers:index" def get_success_url(self): new_container_name = self.request.POST['new_container_name'] @@ -194,7 +194,7 @@ class CopyView(forms.ModalFormView): try: containers = api.swift_get_containers(self.request) except: - redirect = reverse("horizon:nova:containers:index") + redirect = reverse("horizon:project:containers:index") exceptions.handle(self.request, _('Unable to list containers.'), redirect=redirect) diff --git a/horizon/dashboards/nova/dashboard.py b/horizon/dashboards/project/dashboard.py similarity index 93% rename from horizon/dashboards/nova/dashboard.py rename to horizon/dashboards/project/dashboard.py index 822f92621..691d7fa41 100644 --- a/horizon/dashboards/nova/dashboard.py +++ b/horizon/dashboards/project/dashboard.py @@ -36,12 +36,12 @@ class ObjectStorePanels(horizon.PanelGroup): panels = ('containers',) -class Nova(horizon.Dashboard): +class Project(horizon.Dashboard): name = _("Project") - slug = "nova" + slug = "project" panels = (BasePanels, ObjectStorePanels) default_panel = 'overview' supports_tenants = True -horizon.register(Nova) +horizon.register(Project) diff --git a/horizon/dashboards/syspanel/instances/__init__.py b/horizon/dashboards/project/images_and_snapshots/__init__.py similarity index 100% rename from horizon/dashboards/syspanel/instances/__init__.py rename to horizon/dashboards/project/images_and_snapshots/__init__.py diff --git a/horizon/dashboards/syspanel/networks/__init__.py b/horizon/dashboards/project/images_and_snapshots/images/__init__.py similarity index 100% rename from horizon/dashboards/syspanel/networks/__init__.py rename to horizon/dashboards/project/images_and_snapshots/images/__init__.py diff --git a/horizon/dashboards/nova/images_and_snapshots/images/forms.py b/horizon/dashboards/project/images_and_snapshots/images/forms.py similarity index 99% rename from horizon/dashboards/nova/images_and_snapshots/images/forms.py rename to horizon/dashboards/project/images_and_snapshots/images/forms.py index bdaa1df01..39e44f1e0 100644 --- a/horizon/dashboards/nova/images_and_snapshots/images/forms.py +++ b/horizon/dashboards/project/images_and_snapshots/images/forms.py @@ -19,7 +19,7 @@ # under the License. """ -Views for managing Nova images. +Views for managing images. """ import logging diff --git a/horizon/dashboards/nova/images_and_snapshots/images/panel.py b/horizon/dashboards/project/images_and_snapshots/images/panel.py similarity index 91% rename from horizon/dashboards/nova/images_and_snapshots/images/panel.py rename to horizon/dashboards/project/images_and_snapshots/images/panel.py index 13302efc6..ed3abd554 100644 --- a/horizon/dashboards/nova/images_and_snapshots/images/panel.py +++ b/horizon/dashboards/project/images_and_snapshots/images/panel.py @@ -19,7 +19,7 @@ # under the License. import horizon -from horizon.dashboards.nova import dashboard +from horizon.dashboards.project import dashboard class Images(horizon.Panel): @@ -27,4 +27,4 @@ class Images(horizon.Panel): slug = 'images' -dashboard.Nova.register(Images) +dashboard.Project.register(Images) diff --git a/horizon/dashboards/nova/images_and_snapshots/images/tables.py b/horizon/dashboards/project/images_and_snapshots/images/tables.py similarity index 94% rename from horizon/dashboards/nova/images_and_snapshots/images/tables.py rename to horizon/dashboards/project/images_and_snapshots/images/tables.py index 9ec80394f..8ee5ffe60 100644 --- a/horizon/dashboards/nova/images_and_snapshots/images/tables.py +++ b/horizon/dashboards/project/images_and_snapshots/images/tables.py @@ -31,7 +31,7 @@ LOG = logging.getLogger(__name__) class LaunchImage(tables.LinkAction): name = "launch_image" verbose_name = _("Launch") - url = "horizon:nova:instances:launch" + url = "horizon:project:instances:launch" classes = ("btn-launch", "ajax-modal") def get_link_url(self, datum): @@ -58,14 +58,14 @@ class DeleteImage(tables.DeleteAction): class CreateImage(tables.LinkAction): name = "create" verbose_name = _("Create Image") - url = "horizon:nova:images_and_snapshots:images:create" + url = "horizon:project:images_and_snapshots:images:create" classes = ("ajax-modal", "btn-create") class EditImage(tables.LinkAction): name = "edit" verbose_name = _("Edit") - url = "horizon:nova:images_and_snapshots:images:update" + url = "horizon:project:images_and_snapshots:images:update" classes = ("ajax-modal", "btn-edit") def allowed(self, request, image=None): @@ -107,7 +107,7 @@ class ImagesTable(tables.DataTable): ("deleted", False), ) name = tables.Column("name", - link=("horizon:nova:images_and_snapshots:" + link=("horizon:project:images_and_snapshots:" "images:detail"), verbose_name=_("Image Name")) image_type = tables.Column(get_image_type, diff --git a/horizon/dashboards/nova/images_and_snapshots/images/tabs.py b/horizon/dashboards/project/images_and_snapshots/images/tabs.py similarity index 89% rename from horizon/dashboards/nova/images_and_snapshots/images/tabs.py rename to horizon/dashboards/project/images_and_snapshots/images/tabs.py index ef4d30e02..3edb58830 100644 --- a/horizon/dashboards/nova/images_and_snapshots/images/tabs.py +++ b/horizon/dashboards/project/images_and_snapshots/images/tabs.py @@ -25,14 +25,14 @@ from horizon import tabs class OverviewTab(tabs.Tab): name = _("Overview") slug = "overview" - template_name = "nova/images_and_snapshots/images/_detail_overview.html" + template_name = "project/images_and_snapshots/images/_detail_overview.html" def get_context_data(self, request): image_id = self.tab_group.kwargs['image_id'] try: image = api.glance.image_get(self.request, image_id) except: - redirect = reverse('horizon:nova:images_and_snapshots:index') + redirect = reverse('horizon:project:images_and_snapshots:index') exceptions.handle(request, _('Unable to retrieve image details.'), redirect=redirect) diff --git a/horizon/dashboards/nova/images_and_snapshots/images/tests.py b/horizon/dashboards/project/images_and_snapshots/images/tests.py similarity index 85% rename from horizon/dashboards/nova/images_and_snapshots/images/tests.py rename to horizon/dashboards/project/images_and_snapshots/images/tests.py index da342b668..5b2ff8fcd 100644 --- a/horizon/dashboards/nova/images_and_snapshots/images/tests.py +++ b/horizon/dashboards/project/images_and_snapshots/images/tests.py @@ -24,18 +24,18 @@ from django.core.urlresolvers import reverse from horizon import api from horizon import test -from mox import IgnoreArg, IsA +from mox import IsA -IMAGES_INDEX_URL = reverse('horizon:nova:images_and_snapshots:index') +IMAGES_INDEX_URL = reverse('horizon:project:images_and_snapshots:index') class ImageViewTests(test.TestCase): def test_image_create_get(self): - url = reverse('horizon:nova:images_and_snapshots:images:create') + url = reverse('horizon:project:images_and_snapshots:images:create') res = self.client.get(url) self.assertTemplateUsed(res, - 'nova/images_and_snapshots/images/create.html') + 'project/images_and_snapshots/images/create.html') @test.create_stubs({api.glance: ('image_create',)}) def test_image_create_post(self): @@ -61,7 +61,7 @@ class ImageViewTests(test.TestCase): AndReturn(self.images.first()) self.mox.ReplayAll() - url = reverse('horizon:nova:images_and_snapshots:images:create') + url = reverse('horizon:project:images_and_snapshots:images:create') res = self.client.post(url, data) self.assertNoFormErrors(res) @@ -76,10 +76,10 @@ class ImageViewTests(test.TestCase): self.mox.ReplayAll() res = self.client.get( - reverse('horizon:nova:images_and_snapshots:images:detail', + reverse('horizon:project:images_and_snapshots:images:detail', args=[image.id])) self.assertTemplateUsed(res, - 'nova/images_and_snapshots/images/detail.html') + 'project/images_and_snapshots/images/detail.html') self.assertEqual(res.context['image'].name, image.name) @test.create_stubs({api.glance: ('image_get',)}) @@ -90,7 +90,7 @@ class ImageViewTests(test.TestCase): .AndRaise(self.exceptions.glance) self.mox.ReplayAll() - url = reverse('horizon:nova:images_and_snapshots:images:detail', + url = reverse('horizon:project:images_and_snapshots:images:detail', args=[image.id]) res = self.client.get(url) self.assertRedirectsNoFollow(res, IMAGES_INDEX_URL) diff --git a/horizon/dashboards/nova/images_and_snapshots/images/urls.py b/horizon/dashboards/project/images_and_snapshots/images/urls.py similarity index 93% rename from horizon/dashboards/nova/images_and_snapshots/images/urls.py rename to horizon/dashboards/project/images_and_snapshots/images/urls.py index a4e7ad18e..18d4090aa 100644 --- a/horizon/dashboards/nova/images_and_snapshots/images/urls.py +++ b/horizon/dashboards/project/images_and_snapshots/images/urls.py @@ -22,7 +22,7 @@ from django.conf.urls.defaults import patterns, url from .views import UpdateView, DetailView, CreateView -VIEWS_MOD = 'horizon.dashboards.nova.images_and_snapshots.images.views' +VIEWS_MOD = 'horizon.dashboards.project.images_and_snapshots.images.views' urlpatterns = patterns(VIEWS_MOD, diff --git a/horizon/dashboards/nova/images_and_snapshots/images/views.py b/horizon/dashboards/project/images_and_snapshots/images/views.py similarity index 81% rename from horizon/dashboards/nova/images_and_snapshots/images/views.py rename to horizon/dashboards/project/images_and_snapshots/images/views.py index 1142cd163..46862e90b 100644 --- a/horizon/dashboards/nova/images_and_snapshots/images/views.py +++ b/horizon/dashboards/project/images_and_snapshots/images/views.py @@ -19,7 +19,7 @@ # under the License. """ -Views for managing Nova images. +Views for managing images. """ import logging @@ -41,15 +41,15 @@ LOG = logging.getLogger(__name__) class CreateView(forms.ModalFormView): form_class = CreateImageForm - template_name = 'nova/images_and_snapshots/images/create.html' + template_name = 'project/images_and_snapshots/images/create.html' context_object_name = 'image' - success_url = reverse_lazy("horizon:nova:images_and_snapshots:index") + success_url = reverse_lazy("horizon:project:images_and_snapshots:index") class UpdateView(forms.ModalFormView): form_class = UpdateImageForm - template_name = 'nova/images_and_snapshots/images/update.html' - success_url = reverse_lazy("horizon:nova:images_and_snapshots:index") + template_name = 'project/images_and_snapshots/images/update.html' + success_url = reverse_lazy("horizon:project:images_and_snapshots:index") def get_object(self): if not hasattr(self, "_object"): @@ -58,8 +58,8 @@ class UpdateView(forms.ModalFormView): self.kwargs['image_id']) except: msg = _('Unable to retrieve image.') - redirect = reverse('horizon:nova:images_and_snapshots:index') - exceptions.handle(self.request, msg, redirect=redirect) + url = reverse('horizon:project:images_and_snapshots:index') + exceptions.handle(self.request, msg, redirect=url) return self._object def get_context_data(self, **kwargs): @@ -80,4 +80,4 @@ class UpdateView(forms.ModalFormView): class DetailView(tabs.TabView): tab_group_class = ImageDetailTabs - template_name = 'nova/images_and_snapshots/images/detail.html' + template_name = 'project/images_and_snapshots/images/detail.html' diff --git a/horizon/dashboards/nova/images_and_snapshots/panel.py b/horizon/dashboards/project/images_and_snapshots/panel.py similarity index 90% rename from horizon/dashboards/nova/images_and_snapshots/panel.py rename to horizon/dashboards/project/images_and_snapshots/panel.py index 161ac2b3f..c43366369 100644 --- a/horizon/dashboards/nova/images_and_snapshots/panel.py +++ b/horizon/dashboards/project/images_and_snapshots/panel.py @@ -18,7 +18,7 @@ from django.utils.translation import ugettext_lazy as _ import horizon -from horizon.dashboards.nova import dashboard +from horizon.dashboards.project import dashboard class ImagesAndSnapshots(horizon.Panel): @@ -26,4 +26,4 @@ class ImagesAndSnapshots(horizon.Panel): slug = 'images_and_snapshots' -dashboard.Nova.register(ImagesAndSnapshots) +dashboard.Project.register(ImagesAndSnapshots) diff --git a/horizon/dashboards/syspanel/networks/ports/__init__.py b/horizon/dashboards/project/images_and_snapshots/snapshots/__init__.py similarity index 100% rename from horizon/dashboards/syspanel/networks/ports/__init__.py rename to horizon/dashboards/project/images_and_snapshots/snapshots/__init__.py diff --git a/horizon/dashboards/nova/images_and_snapshots/snapshots/forms.py b/horizon/dashboards/project/images_and_snapshots/snapshots/forms.py similarity index 97% rename from horizon/dashboards/nova/images_and_snapshots/snapshots/forms.py rename to horizon/dashboards/project/images_and_snapshots/snapshots/forms.py index 7ff117130..4ff92a6c8 100644 --- a/horizon/dashboards/nova/images_and_snapshots/snapshots/forms.py +++ b/horizon/dashboards/project/images_and_snapshots/snapshots/forms.py @@ -50,7 +50,7 @@ class CreateSnapshot(forms.SelfHandlingForm): 'instance "%(inst)s"') % vals) return snapshot except: - redirect = reverse("horizon:nova:instances:index") + redirect = reverse("horizon:project:instances:index") exceptions.handle(request, _('Unable to create snapshot.'), redirect=redirect) diff --git a/horizon/dashboards/nova/images_and_snapshots/snapshots/panel.py b/horizon/dashboards/project/images_and_snapshots/snapshots/panel.py similarity index 91% rename from horizon/dashboards/nova/images_and_snapshots/snapshots/panel.py rename to horizon/dashboards/project/images_and_snapshots/snapshots/panel.py index 5a6edb62b..bcc96aeb6 100644 --- a/horizon/dashboards/nova/images_and_snapshots/snapshots/panel.py +++ b/horizon/dashboards/project/images_and_snapshots/snapshots/panel.py @@ -19,7 +19,7 @@ # under the License. import horizon -from horizon.dashboards.nova import dashboard +from horizon.dashboards.project import dashboard class Snapshots(horizon.Panel): @@ -27,4 +27,4 @@ class Snapshots(horizon.Panel): slug = 'snapshots' -dashboard.Nova.register(Snapshots) +dashboard.Project.register(Snapshots) diff --git a/horizon/dashboards/nova/images_and_snapshots/snapshots/tables.py b/horizon/dashboards/project/images_and_snapshots/snapshots/tables.py similarity index 97% rename from horizon/dashboards/nova/images_and_snapshots/snapshots/tables.py rename to horizon/dashboards/project/images_and_snapshots/snapshots/tables.py index 62d32c4bd..1d281e4c6 100644 --- a/horizon/dashboards/nova/images_and_snapshots/snapshots/tables.py +++ b/horizon/dashboards/project/images_and_snapshots/snapshots/tables.py @@ -30,7 +30,7 @@ LOG = logging.getLogger(__name__) class LaunchSnapshot(tables.LinkAction): name = "launch_snapshot" verbose_name = _("Launch") - url = "horizon:nova:instances:launch" + url = "horizon:project:instances:launch" classes = ("btn-launch", "ajax-modal") def get_link_url(self, datum): diff --git a/horizon/dashboards/nova/images_and_snapshots/snapshots/tests.py b/horizon/dashboards/project/images_and_snapshots/snapshots/tests.py similarity index 84% rename from horizon/dashboards/nova/images_and_snapshots/snapshots/tests.py rename to horizon/dashboards/project/images_and_snapshots/snapshots/tests.py index 409ec519b..ca24aba6d 100644 --- a/horizon/dashboards/nova/images_and_snapshots/snapshots/tests.py +++ b/horizon/dashboards/project/images_and_snapshots/snapshots/tests.py @@ -26,7 +26,7 @@ from horizon import api from horizon import test -INDEX_URL = reverse('horizon:nova:images_and_snapshots:index') +INDEX_URL = reverse('horizon:project:images_and_snapshots:index') class SnapshotsViewTests(test.TestCase): @@ -36,11 +36,11 @@ class SnapshotsViewTests(test.TestCase): api.server_get(IsA(http.HttpRequest), server.id).AndReturn(server) self.mox.ReplayAll() - url = reverse('horizon:nova:images_and_snapshots:snapshots:create', + url = reverse('horizon:project:images_and_snapshots:snapshots:create', args=[server.id]) res = self.client.get(url) self.assertTemplateUsed(res, - 'nova/images_and_snapshots/snapshots/create.html') + 'project/images_and_snapshots/snapshots/create.html') def test_create_get_server_exception(self): server = self.servers.first() @@ -49,10 +49,10 @@ class SnapshotsViewTests(test.TestCase): .AndRaise(self.exceptions.nova) self.mox.ReplayAll() - url = reverse('horizon:nova:images_and_snapshots:snapshots:create', + url = reverse('horizon:project:images_and_snapshots:snapshots:create', args=[server.id]) res = self.client.get(url) - redirect = reverse("horizon:nova:instances:index") + redirect = reverse("horizon:project:instances:index") self.assertRedirectsNoFollow(res, redirect) def test_create_snapshot_post(self): @@ -70,7 +70,7 @@ class SnapshotsViewTests(test.TestCase): 'tenant_id': self.tenant.id, 'instance_id': server.id, 'name': snapshot.name} - url = reverse('horizon:nova:images_and_snapshots:snapshots:create', + url = reverse('horizon:project:images_and_snapshots:snapshots:create', args=[server.id]) res = self.client.post(url, formData) @@ -90,8 +90,8 @@ class SnapshotsViewTests(test.TestCase): 'tenant_id': self.tenant.id, 'instance_id': server.id, 'name': snapshot.name} - url = reverse('horizon:nova:images_and_snapshots:snapshots:create', + url = reverse('horizon:project:images_and_snapshots:snapshots:create', args=[server.id]) res = self.client.post(url, formData) - redirect = reverse("horizon:nova:instances:index") + redirect = reverse("horizon:project:instances:index") self.assertRedirectsNoFollow(res, redirect) diff --git a/horizon/dashboards/nova/images_and_snapshots/snapshots/urls.py b/horizon/dashboards/project/images_and_snapshots/snapshots/urls.py similarity index 100% rename from horizon/dashboards/nova/images_and_snapshots/snapshots/urls.py rename to horizon/dashboards/project/images_and_snapshots/snapshots/urls.py diff --git a/horizon/dashboards/nova/images_and_snapshots/snapshots/views.py b/horizon/dashboards/project/images_and_snapshots/snapshots/views.py similarity index 87% rename from horizon/dashboards/nova/images_and_snapshots/snapshots/views.py rename to horizon/dashboards/project/images_and_snapshots/snapshots/views.py index eee693600..34a2920eb 100644 --- a/horizon/dashboards/nova/images_and_snapshots/snapshots/views.py +++ b/horizon/dashboards/project/images_and_snapshots/snapshots/views.py @@ -19,7 +19,7 @@ # under the License. """ -Views for managing Nova instance snapshots. +Views for managing instance snapshots. """ import logging @@ -38,8 +38,8 @@ LOG = logging.getLogger(__name__) class CreateView(forms.ModalFormView): form_class = CreateSnapshot - template_name = 'nova/images_and_snapshots/snapshots/create.html' - success_url = reverse_lazy("horizon:nova:images_and_snapshots:index") + template_name = 'project/images_and_snapshots/snapshots/create.html' + success_url = reverse_lazy("horizon:project:images_and_snapshots:index") def get_object(self): if not hasattr(self, "_object"): @@ -47,7 +47,7 @@ class CreateView(forms.ModalFormView): self._object = api.server_get(self.request, self.kwargs["instance_id"]) except: - redirect = reverse('horizon:nova:instances:index') + redirect = reverse('horizon:project:instances:index') exceptions.handle(self.request, _("Unable to retrieve instance."), redirect=redirect) diff --git a/horizon/dashboards/nova/images_and_snapshots/templates/images_and_snapshots/images/_create.html b/horizon/dashboards/project/images_and_snapshots/templates/images_and_snapshots/images/_create.html similarity index 83% rename from horizon/dashboards/nova/images_and_snapshots/templates/images_and_snapshots/images/_create.html rename to horizon/dashboards/project/images_and_snapshots/templates/images_and_snapshots/images/_create.html index 165e0776b..f06cfd9f0 100644 --- a/horizon/dashboards/nova/images_and_snapshots/templates/images_and_snapshots/images/_create.html +++ b/horizon/dashboards/project/images_and_snapshots/templates/images_and_snapshots/images/_create.html @@ -2,7 +2,7 @@ {% load i18n %} {% block form_id %}create_image_form{% endblock %} -{% block form_action %}{% url horizon:nova:images_and_snapshots:images:create %}{% endblock %} +{% block form_action %}{% url horizon:project:images_and_snapshots:images:create %}{% endblock %} {% block modal-header %}{% trans "Create An Image" %}{% endblock %} @@ -29,5 +29,5 @@ {% block modal-footer %} - {% trans "Cancel" %} + {% trans "Cancel" %} {% endblock %} diff --git a/horizon/dashboards/nova/images_and_snapshots/templates/images_and_snapshots/images/_detail_overview.html b/horizon/dashboards/project/images_and_snapshots/templates/images_and_snapshots/images/_detail_overview.html similarity index 100% rename from horizon/dashboards/nova/images_and_snapshots/templates/images_and_snapshots/images/_detail_overview.html rename to horizon/dashboards/project/images_and_snapshots/templates/images_and_snapshots/images/_detail_overview.html diff --git a/horizon/dashboards/nova/images_and_snapshots/templates/images_and_snapshots/images/_update.html b/horizon/dashboards/project/images_and_snapshots/templates/images_and_snapshots/images/_update.html similarity index 72% rename from horizon/dashboards/nova/images_and_snapshots/templates/images_and_snapshots/images/_update.html rename to horizon/dashboards/project/images_and_snapshots/templates/images_and_snapshots/images/_update.html index 5b001d08a..c94176fd7 100644 --- a/horizon/dashboards/nova/images_and_snapshots/templates/images_and_snapshots/images/_update.html +++ b/horizon/dashboards/project/images_and_snapshots/templates/images_and_snapshots/images/_update.html @@ -2,7 +2,7 @@ {% load i18n %} {% block form_id %}update_image_form{% endblock %} -{% block form_action %}{% url horizon:nova:images_and_snapshots:images:update image.id %}{% endblock %} +{% block form_action %}{% url horizon:project:images_and_snapshots:images:update image.id %}{% endblock %} {% block modal-header %}{% trans "Update Image" %}{% endblock %} @@ -20,5 +20,5 @@ {% block modal-footer %} - {% trans "Cancel" %} + {% trans "Cancel" %} {% endblock %} diff --git a/horizon/dashboards/nova/images_and_snapshots/templates/images_and_snapshots/images/create.html b/horizon/dashboards/project/images_and_snapshots/templates/images_and_snapshots/images/create.html similarity index 80% rename from horizon/dashboards/nova/images_and_snapshots/templates/images_and_snapshots/images/create.html rename to horizon/dashboards/project/images_and_snapshots/templates/images_and_snapshots/images/create.html index ea59340d5..e8f92f7f2 100644 --- a/horizon/dashboards/nova/images_and_snapshots/templates/images_and_snapshots/images/create.html +++ b/horizon/dashboards/project/images_and_snapshots/templates/images_and_snapshots/images/create.html @@ -7,5 +7,5 @@ {% endblock page_header %} {% block main %} - {% include 'nova/images_and_snapshots/images/_create.html' %} + {% include 'project/images_and_snapshots/images/_create.html' %} {% endblock %} diff --git a/horizon/dashboards/nova/images_and_snapshots/templates/images_and_snapshots/images/detail.html b/horizon/dashboards/project/images_and_snapshots/templates/images_and_snapshots/images/detail.html similarity index 100% rename from horizon/dashboards/nova/images_and_snapshots/templates/images_and_snapshots/images/detail.html rename to horizon/dashboards/project/images_and_snapshots/templates/images_and_snapshots/images/detail.html diff --git a/horizon/dashboards/nova/images_and_snapshots/templates/images_and_snapshots/images/update.html b/horizon/dashboards/project/images_and_snapshots/templates/images_and_snapshots/images/update.html similarity index 79% rename from horizon/dashboards/nova/images_and_snapshots/templates/images_and_snapshots/images/update.html rename to horizon/dashboards/project/images_and_snapshots/templates/images_and_snapshots/images/update.html index 579868262..604898b89 100644 --- a/horizon/dashboards/nova/images_and_snapshots/templates/images_and_snapshots/images/update.html +++ b/horizon/dashboards/project/images_and_snapshots/templates/images_and_snapshots/images/update.html @@ -7,5 +7,5 @@ {% endblock page_header %} {% block main %} - {% include 'nova/images_and_snapshots/images/_update.html' %} + {% include 'project/images_and_snapshots/images/_update.html' %} {% endblock %} diff --git a/horizon/dashboards/nova/images_and_snapshots/templates/images_and_snapshots/index.html b/horizon/dashboards/project/images_and_snapshots/templates/images_and_snapshots/index.html similarity index 100% rename from horizon/dashboards/nova/images_and_snapshots/templates/images_and_snapshots/index.html rename to horizon/dashboards/project/images_and_snapshots/templates/images_and_snapshots/index.html diff --git a/horizon/dashboards/nova/images_and_snapshots/templates/images_and_snapshots/snapshots/_create.html b/horizon/dashboards/project/images_and_snapshots/templates/images_and_snapshots/snapshots/_create.html similarity index 73% rename from horizon/dashboards/nova/images_and_snapshots/templates/images_and_snapshots/snapshots/_create.html rename to horizon/dashboards/project/images_and_snapshots/templates/images_and_snapshots/snapshots/_create.html index d907f450a..d2bf9b957 100644 --- a/horizon/dashboards/nova/images_and_snapshots/templates/images_and_snapshots/snapshots/_create.html +++ b/horizon/dashboards/project/images_and_snapshots/templates/images_and_snapshots/snapshots/_create.html @@ -2,7 +2,7 @@ {% load i18n %} {% block form_id %}create_snapshot_form{% endblock %} -{% block form_action %}{% url horizon:nova:images_and_snapshots:snapshots:create instance.id %}{% endblock %} +{% block form_action %}{% url horizon:project:images_and_snapshots:snapshots:create instance.id %}{% endblock %} {% block modal_id %}create_snapshot_modal{% endblock %} {% block modal-header %}{% trans "Create Snapshot" %}{% endblock %} @@ -21,5 +21,5 @@ {% block modal-footer %} - {% trans "Cancel" %} + {% trans "Cancel" %} {% endblock %} diff --git a/horizon/dashboards/nova/images_and_snapshots/templates/images_and_snapshots/snapshots/_detail_overview.html b/horizon/dashboards/project/images_and_snapshots/templates/images_and_snapshots/snapshots/_detail_overview.html similarity index 93% rename from horizon/dashboards/nova/images_and_snapshots/templates/images_and_snapshots/snapshots/_detail_overview.html rename to horizon/dashboards/project/images_and_snapshots/templates/images_and_snapshots/snapshots/_detail_overview.html index 499d10998..484bd0e3a 100644 --- a/horizon/dashboards/nova/images_and_snapshots/templates/images_and_snapshots/snapshots/_detail_overview.html +++ b/horizon/dashboards/project/images_and_snapshots/templates/images_and_snapshots/snapshots/_detail_overview.html @@ -19,7 +19,7 @@
{{ snapshot.status|capfirst }}
{% trans "Volume" %}
- + {% if volume.display_name %} {{ volume.display_name }} {% else %} diff --git a/horizon/dashboards/nova/images_and_snapshots/templates/images_and_snapshots/snapshots/create.html b/horizon/dashboards/project/images_and_snapshots/templates/images_and_snapshots/snapshots/create.html similarity index 79% rename from horizon/dashboards/nova/images_and_snapshots/templates/images_and_snapshots/snapshots/create.html rename to horizon/dashboards/project/images_and_snapshots/templates/images_and_snapshots/snapshots/create.html index 7438fc71b..51c7d4b5c 100644 --- a/horizon/dashboards/nova/images_and_snapshots/templates/images_and_snapshots/snapshots/create.html +++ b/horizon/dashboards/project/images_and_snapshots/templates/images_and_snapshots/snapshots/create.html @@ -7,5 +7,5 @@ {% endblock page_header %} {% block main %} - {% include 'nova/images_and_snapshots/snapshots/_create.html' %} + {% include 'project/images_and_snapshots/snapshots/_create.html' %} {% endblock %} diff --git a/horizon/dashboards/nova/images_and_snapshots/templates/images_and_snapshots/snapshots/detail.html b/horizon/dashboards/project/images_and_snapshots/templates/images_and_snapshots/snapshots/detail.html similarity index 100% rename from horizon/dashboards/nova/images_and_snapshots/templates/images_and_snapshots/snapshots/detail.html rename to horizon/dashboards/project/images_and_snapshots/templates/images_and_snapshots/snapshots/detail.html diff --git a/horizon/dashboards/nova/images_and_snapshots/tests.py b/horizon/dashboards/project/images_and_snapshots/tests.py similarity index 94% rename from horizon/dashboards/nova/images_and_snapshots/tests.py rename to horizon/dashboards/project/images_and_snapshots/tests.py index d2d4324a5..5b4b9112d 100644 --- a/horizon/dashboards/nova/images_and_snapshots/tests.py +++ b/horizon/dashboards/project/images_and_snapshots/tests.py @@ -27,7 +27,7 @@ from horizon import api from horizon import test -INDEX_URL = reverse('horizon:nova:images_and_snapshots:index') +INDEX_URL = reverse('horizon:project:images_and_snapshots:index') class ImagesAndSnapshotsTests(test.TestCase): @@ -57,7 +57,7 @@ class ImagesAndSnapshotsTests(test.TestCase): self.mox.ReplayAll() res = self.client.get(INDEX_URL) - self.assertTemplateUsed(res, 'nova/images_and_snapshots/index.html') + self.assertTemplateUsed(res, 'project/images_and_snapshots/index.html') self.assertIn('images_table', res.context) images = res.context['images_table'].data filter_func = lambda im: im.container_format not in ['aki', 'ari'] @@ -88,7 +88,7 @@ class ImagesAndSnapshotsTests(test.TestCase): self.mox.ReplayAll() res = self.client.get(INDEX_URL) - self.assertTemplateUsed(res, 'nova/images_and_snapshots/index.html') + self.assertTemplateUsed(res, 'project/images_and_snapshots/index.html') @test.create_stubs({api: ('image_list_detailed', 'snapshot_list_detailed', 'volume_snapshot_list', 'volume_get',)}) @@ -114,7 +114,7 @@ class ImagesAndSnapshotsTests(test.TestCase): self.mox.ReplayAll() res = self.client.get(INDEX_URL) - self.assertTemplateUsed(res, 'nova/images_and_snapshots/index.html') + self.assertTemplateUsed(res, 'project/images_and_snapshots/index.html') @test.create_stubs({api: ('image_list_detailed', 'snapshot_list_detailed', 'volume_snapshot_list', 'volume_get',)}) @@ -142,7 +142,7 @@ class ImagesAndSnapshotsTests(test.TestCase): self.mox.ReplayAll() res = self.client.get(INDEX_URL) - self.assertTemplateUsed(res, 'nova/images_and_snapshots/index.html') + self.assertTemplateUsed(res, 'project/images_and_snapshots/index.html') self.assertIn('snapshots_table', res.context) snaps = res.context['snapshots_table'] self.assertEqual(len(snaps.get_rows()), 3) diff --git a/horizon/dashboards/nova/images_and_snapshots/urls.py b/horizon/dashboards/project/images_and_snapshots/urls.py similarity index 100% rename from horizon/dashboards/nova/images_and_snapshots/urls.py rename to horizon/dashboards/project/images_and_snapshots/urls.py diff --git a/horizon/dashboards/nova/images_and_snapshots/views.py b/horizon/dashboards/project/images_and_snapshots/views.py similarity index 95% rename from horizon/dashboards/nova/images_and_snapshots/views.py rename to horizon/dashboards/project/images_and_snapshots/views.py index bade47e4e..063652498 100644 --- a/horizon/dashboards/nova/images_and_snapshots/views.py +++ b/horizon/dashboards/project/images_and_snapshots/views.py @@ -41,7 +41,7 @@ LOG = logging.getLogger(__name__) class IndexView(tables.MultiTableView): table_classes = (ImagesTable, SnapshotsTable, VolumeSnapshotsTable) - template_name = 'nova/images_and_snapshots/index.html' + template_name = 'project/images_and_snapshots/index.html' def has_more_data(self, table): return getattr(self, "_more_%s" % table.name, False) @@ -85,4 +85,4 @@ class IndexView(tables.MultiTableView): class DetailView(tabs.TabView): tab_group_class = SnapshotDetailTabs - template_name = 'nova/images_and_snapshots/snapshots/detail.html' + template_name = 'project/images_and_snapshots/snapshots/detail.html' diff --git a/horizon/dashboards/syspanel/networks/subnets/__init__.py b/horizon/dashboards/project/images_and_snapshots/volume_snapshots/__init__.py similarity index 100% rename from horizon/dashboards/syspanel/networks/subnets/__init__.py rename to horizon/dashboards/project/images_and_snapshots/volume_snapshots/__init__.py diff --git a/horizon/dashboards/nova/images_and_snapshots/volume_snapshots/panel.py b/horizon/dashboards/project/images_and_snapshots/volume_snapshots/panel.py similarity index 89% rename from horizon/dashboards/nova/images_and_snapshots/volume_snapshots/panel.py rename to horizon/dashboards/project/images_and_snapshots/volume_snapshots/panel.py index 6aff53aaa..c35c724f7 100644 --- a/horizon/dashboards/nova/images_and_snapshots/volume_snapshots/panel.py +++ b/horizon/dashboards/project/images_and_snapshots/volume_snapshots/panel.py @@ -15,7 +15,7 @@ # under the License. import horizon -from horizon.dashboards.nova import dashboard +from horizon.dashboards.project import dashboard class VolumeSnapshots(horizon.Panel): @@ -23,4 +23,4 @@ class VolumeSnapshots(horizon.Panel): slug = 'volume_snapshots' -dashboard.Nova.register(VolumeSnapshots) +dashboard.Project.register(VolumeSnapshots) diff --git a/horizon/dashboards/nova/images_and_snapshots/volume_snapshots/tables.py b/horizon/dashboards/project/images_and_snapshots/volume_snapshots/tables.py similarity index 93% rename from horizon/dashboards/nova/images_and_snapshots/volume_snapshots/tables.py rename to horizon/dashboards/project/images_and_snapshots/volume_snapshots/tables.py index b782d4109..ea776bb57 100644 --- a/horizon/dashboards/nova/images_and_snapshots/volume_snapshots/tables.py +++ b/horizon/dashboards/project/images_and_snapshots/volume_snapshots/tables.py @@ -40,7 +40,7 @@ class DeleteVolumeSnapshot(tables.DeleteAction): class CreateVolumeFromSnapshot(tables.LinkAction): name = "create_from_snapshot" verbose_name = _("Create Volume") - url = "horizon:nova:volumes:create" + url = "horizon:project:volumes:create" classes = ("ajax-modal", "btn-camera") def get_link_url(self, datum): @@ -74,10 +74,10 @@ class SnapshotVolumeNameColumn(tables.Column): class VolumeSnapshotsTable(volume_tables.VolumesTableBase): name = tables.Column("display_name", verbose_name=_("Name"), - link="horizon:nova:images_and_snapshots:detail") + link="horizon:project:images_and_snapshots:detail") volume_name = SnapshotVolumeNameColumn("display_name", verbose_name=_("Volume Name"), - link="horizon:nova:volumes:detail") + link="horizon:project:volumes:detail") class Meta: name = "volume_snapshots" diff --git a/horizon/dashboards/nova/images_and_snapshots/volume_snapshots/tabs.py b/horizon/dashboards/project/images_and_snapshots/volume_snapshots/tabs.py similarity index 91% rename from horizon/dashboards/nova/images_and_snapshots/volume_snapshots/tabs.py rename to horizon/dashboards/project/images_and_snapshots/volume_snapshots/tabs.py index 6aa87877d..81684b7f3 100644 --- a/horizon/dashboards/nova/images_and_snapshots/volume_snapshots/tabs.py +++ b/horizon/dashboards/project/images_and_snapshots/volume_snapshots/tabs.py @@ -25,7 +25,7 @@ from horizon import tabs class OverviewTab(tabs.Tab): name = _("Overview") slug = "overview" - template_name = ("nova/images_and_snapshots/snapshots/" + template_name = ("project/images_and_snapshots/snapshots/" "_detail_overview.html") def get_context_data(self, request): @@ -35,7 +35,7 @@ class OverviewTab(tabs.Tab): volume = api.nova.volume_get(request, snapshot.volume_id) volume.display_name = None except: - redirect = reverse('horizon:nova:images_and_snapshots:index') + redirect = reverse('horizon:project:images_and_snapshots:index') exceptions.handle(self.request, _('Unable to retrieve snapshot details.'), redirect=redirect) diff --git a/horizon/dashboards/nova/images_and_snapshots/volume_snapshots/tests.py b/horizon/dashboards/project/images_and_snapshots/volume_snapshots/tests.py similarity index 83% rename from horizon/dashboards/nova/images_and_snapshots/volume_snapshots/tests.py rename to horizon/dashboards/project/images_and_snapshots/volume_snapshots/tests.py index fafecd9ed..948134028 100644 --- a/horizon/dashboards/nova/images_and_snapshots/volume_snapshots/tests.py +++ b/horizon/dashboards/project/images_and_snapshots/volume_snapshots/tests.py @@ -26,16 +26,17 @@ from horizon import api from horizon import test -INDEX_URL = reverse('horizon:nova:images_and_snapshots:index') +INDEX_URL = reverse('horizon:project:images_and_snapshots:index') class VolumeSnapshotsViewTests(test.TestCase): def test_create_snapshot_get(self): volume = self.volumes.first() - res = self.client.get(reverse('horizon:nova:volumes:create_snapshot', - args=[volume.id])) + url = reverse('horizon:project:volumes:create_snapshot', + args=[volume.id]) + res = self.client.get(url) - self.assertTemplateUsed(res, 'nova/volumes/create_snapshot.html') + self.assertTemplateUsed(res, 'project/volumes/create_snapshot.html') def test_create_snapshot_post(self): volume = self.volumes.first() @@ -54,6 +55,7 @@ class VolumeSnapshotsViewTests(test.TestCase): 'volume_id': volume.id, 'name': snapshot.display_name, 'description': snapshot.display_description} - url = reverse('horizon:nova:volumes:create_snapshot', args=[volume.id]) + url = reverse('horizon:project:volumes:create_snapshot', + args=[volume.id]) res = self.client.post(url, formData) self.assertRedirectsNoFollow(res, INDEX_URL) diff --git a/horizon/dashboards/syspanel/overview/__init__.py b/horizon/dashboards/project/instances/__init__.py similarity index 100% rename from horizon/dashboards/syspanel/overview/__init__.py rename to horizon/dashboards/project/instances/__init__.py diff --git a/horizon/dashboards/nova/instances/forms.py b/horizon/dashboards/project/instances/forms.py similarity index 96% rename from horizon/dashboards/nova/instances/forms.py rename to horizon/dashboards/project/instances/forms.py index edca46049..6d3d55e11 100644 --- a/horizon/dashboards/nova/instances/forms.py +++ b/horizon/dashboards/project/instances/forms.py @@ -44,7 +44,7 @@ class UpdateInstance(forms.SelfHandlingForm): _('Instance "%s" updated.') % data['name']) return server except: - redirect = reverse("horizon:nova:instances:index") + redirect = reverse("horizon:project:instances:index") exceptions.handle(request, _('Unable to update instance.'), redirect=redirect) diff --git a/horizon/dashboards/nova/instances/panel.py b/horizon/dashboards/project/instances/panel.py similarity index 90% rename from horizon/dashboards/nova/instances/panel.py rename to horizon/dashboards/project/instances/panel.py index 1a4ab8d67..d59210031 100644 --- a/horizon/dashboards/nova/instances/panel.py +++ b/horizon/dashboards/project/instances/panel.py @@ -17,7 +17,7 @@ from django.utils.translation import ugettext_lazy as _ import horizon -from horizon.dashboards.nova import dashboard +from horizon.dashboards.project import dashboard class Instances(horizon.Panel): @@ -25,4 +25,4 @@ class Instances(horizon.Panel): slug = 'instances' -dashboard.Nova.register(Instances) +dashboard.Project.register(Instances) diff --git a/horizon/dashboards/nova/instances/tables.py b/horizon/dashboards/project/instances/tables.py similarity index 94% rename from horizon/dashboards/nova/instances/tables.py rename to horizon/dashboards/project/instances/tables.py index 380bfe7c4..013f75788 100644 --- a/horizon/dashboards/nova/instances/tables.py +++ b/horizon/dashboards/project/instances/tables.py @@ -27,7 +27,7 @@ from horizon import tables from horizon.templatetags import sizeformat from horizon.utils.filters import replace_underscores -from horizon.dashboards.nova.access_and_security \ +from horizon.dashboards.project.access_and_security \ .floating_ips.workflows import IPAssociationWorkflow from .tabs import InstanceDetailTabs, LogTab, VNCTab @@ -160,14 +160,14 @@ class ToggleSuspend(tables.BatchAction): class LaunchLink(tables.LinkAction): name = "launch" verbose_name = _("Launch Instance") - url = "horizon:nova:instances:launch" + url = "horizon:project:instances:launch" classes = ("btn-launch", "ajax-modal") class EditInstance(tables.LinkAction): name = "edit" verbose_name = _("Edit Instance") - url = "horizon:nova:instances:update" + url = "horizon:project:instances:update" classes = ("ajax-modal", "btn-edit") def allowed(self, request, instance): @@ -177,7 +177,7 @@ class EditInstance(tables.LinkAction): class CreateSnapshot(tables.LinkAction): name = "snapshot" verbose_name = _("Create Snapshot") - url = "horizon:nova:images_and_snapshots:snapshots:create" + url = "horizon:project:images_and_snapshots:snapshots:create" classes = ("ajax-modal", "btn-camera") def allowed(self, request, instance=None): @@ -187,7 +187,7 @@ class CreateSnapshot(tables.LinkAction): class ConsoleLink(tables.LinkAction): name = "console" verbose_name = _("VNC Console") - url = "horizon:nova:instances:detail" + url = "horizon:project:instances:detail" classes = ("btn-console",) def allowed(self, request, instance=None): @@ -202,7 +202,7 @@ class ConsoleLink(tables.LinkAction): class LogLink(tables.LinkAction): name = "log" verbose_name = _("View Log") - url = "horizon:nova:instances:detail" + url = "horizon:project:instances:detail" classes = ("btn-log",) def allowed(self, request, instance=None): @@ -217,7 +217,7 @@ class LogLink(tables.LinkAction): class AssociateIP(tables.LinkAction): name = "associate" verbose_name = _("Associate Floating IP") - url = "horizon:nova:access_and_security:floating_ips:associate" + url = "horizon:project:access_and_security:floating_ips:associate" classes = ("ajax-modal", "btn-associate") def allowed(self, request, instance): @@ -225,7 +225,7 @@ class AssociateIP(tables.LinkAction): def get_link_url(self, datum): base_url = urlresolvers.reverse(self.url) - next = urlresolvers.reverse("horizon:nova:instances:index") + next = urlresolvers.reverse("horizon:project:instances:index") params = {"instance_id": self.table.get_object_id(datum), IPAssociationWorkflow.redirect_param_name: next} params = urlencode(params) @@ -242,7 +242,7 @@ class UpdateRow(tables.Row): def get_ips(instance): - template_name = 'nova/instances/_instance_ips.html' + template_name = 'project/instances/_instance_ips.html' context = {"instance": instance} return template.loader.render_to_string(template_name, context) @@ -286,7 +286,7 @@ class InstancesTable(tables.DataTable): ("image_snapshot", "Snapshotting"), ) name = tables.Column("name", - link=("horizon:nova:instances:detail"), + link=("horizon:project:instances:detail"), verbose_name=_("Instance Name")) ip = tables.Column(get_ips, verbose_name=_("IP Address")) size = tables.Column(get_size, diff --git a/horizon/dashboards/nova/instances/tabs.py b/horizon/dashboards/project/instances/tabs.py similarity index 94% rename from horizon/dashboards/nova/instances/tabs.py rename to horizon/dashboards/project/instances/tabs.py index d38feb59d..309ede2d8 100644 --- a/horizon/dashboards/nova/instances/tabs.py +++ b/horizon/dashboards/project/instances/tabs.py @@ -24,7 +24,7 @@ from horizon import tabs class OverviewTab(tabs.Tab): name = _("Overview") slug = "overview" - template_name = ("nova/instances/" + template_name = ("project/instances/" "_detail_overview.html") def get_context_data(self, request): @@ -34,7 +34,7 @@ class OverviewTab(tabs.Tab): class LogTab(tabs.Tab): name = _("Log") slug = "log" - template_name = "nova/instances/_detail_log.html" + template_name = "project/instances/_detail_log.html" preload = False def get_context_data(self, request): @@ -53,7 +53,7 @@ class LogTab(tabs.Tab): class VNCTab(tabs.Tab): name = _("VNC") slug = "vnc" - template_name = "nova/instances/_detail_vnc.html" + template_name = "project/instances/_detail_vnc.html" preload = False def get_context_data(self, request): diff --git a/horizon/dashboards/nova/instances/templates/instances/_detail_log.html b/horizon/dashboards/project/instances/templates/instances/_detail_log.html similarity index 71% rename from horizon/dashboards/nova/instances/templates/instances/_detail_log.html rename to horizon/dashboards/project/instances/templates/instances/_detail_log.html index f6d33cb0c..79ad9098c 100644 --- a/horizon/dashboards/nova/instances/templates/instances/_detail_log.html +++ b/horizon/dashboards/project/instances/templates/instances/_detail_log.html @@ -3,11 +3,11 @@ diff --git a/horizon/dashboards/nova/instances/templates/instances/_detail_overview.html b/horizon/dashboards/project/instances/templates/instances/_detail_overview.html similarity index 91% rename from horizon/dashboards/nova/instances/templates/instances/_detail_overview.html rename to horizon/dashboards/project/instances/templates/instances/_detail_overview.html index cebc82862..c71f87d1a 100644 --- a/horizon/dashboards/nova/instances/templates/instances/_detail_overview.html +++ b/horizon/dashboards/project/instances/templates/instances/_detail_overview.html @@ -70,7 +70,7 @@
{% trans "Key Name" %}
{{ instance.key_name|default:"None" }}
- {% url horizon:nova:images_and_snapshots:images:detail instance.image.id as image_url %} + {% url horizon:project:images_and_snapshots:images:detail instance.image.id as image_url %}
{% trans "Image Name" %}
{{ instance.image_name }}
{% for key, value in instance.metadata.items %} @@ -87,7 +87,7 @@ {% for volume in instance.volumes %}
{% trans "Attached To" %}
- {{ volume.name }} {% trans "on" %} {{ volume.device }} + {{ volume.name }} {% trans "on" %} {{ volume.device }}
{% empty %}
{% trans "Volume" %}
diff --git a/horizon/dashboards/nova/instances/templates/instances/_detail_vnc.html b/horizon/dashboards/project/instances/templates/instances/_detail_vnc.html similarity index 79% rename from horizon/dashboards/nova/instances/templates/instances/_detail_vnc.html rename to horizon/dashboards/project/instances/templates/instances/_detail_vnc.html index 143b5e88c..02abba7dc 100644 --- a/horizon/dashboards/nova/instances/templates/instances/_detail_vnc.html +++ b/horizon/dashboards/project/instances/templates/instances/_detail_vnc.html @@ -6,5 +6,5 @@ {% else %}

{% blocktrans %}VNC console is currently unavailabe. Please try again later.{% endblocktrans %} -{% trans "Reload" %}

+{% trans "Reload" %}

{% endif %} \ No newline at end of file diff --git a/horizon/dashboards/nova/instances/templates/instances/_instance_ips.html b/horizon/dashboards/project/instances/templates/instances/_instance_ips.html similarity index 100% rename from horizon/dashboards/nova/instances/templates/instances/_instance_ips.html rename to horizon/dashboards/project/instances/templates/instances/_instance_ips.html diff --git a/horizon/dashboards/nova/instances/templates/instances/_launch_customize_help.html b/horizon/dashboards/project/instances/templates/instances/_launch_customize_help.html similarity index 100% rename from horizon/dashboards/nova/instances/templates/instances/_launch_customize_help.html rename to horizon/dashboards/project/instances/templates/instances/_launch_customize_help.html diff --git a/horizon/dashboards/nova/instances/templates/instances/_launch_details_help.html b/horizon/dashboards/project/instances/templates/instances/_launch_details_help.html similarity index 100% rename from horizon/dashboards/nova/instances/templates/instances/_launch_details_help.html rename to horizon/dashboards/project/instances/templates/instances/_launch_details_help.html diff --git a/horizon/dashboards/nova/instances/templates/instances/_launch_volumes_help.html b/horizon/dashboards/project/instances/templates/instances/_launch_volumes_help.html similarity index 100% rename from horizon/dashboards/nova/instances/templates/instances/_launch_volumes_help.html rename to horizon/dashboards/project/instances/templates/instances/_launch_volumes_help.html diff --git a/horizon/dashboards/nova/instances/templates/instances/_update.html b/horizon/dashboards/project/instances/templates/instances/_update.html similarity index 75% rename from horizon/dashboards/nova/instances/templates/instances/_update.html rename to horizon/dashboards/project/instances/templates/instances/_update.html index 71795b0d7..996435f1e 100644 --- a/horizon/dashboards/nova/instances/templates/instances/_update.html +++ b/horizon/dashboards/project/instances/templates/instances/_update.html @@ -2,7 +2,7 @@ {% load i18n %} {% block form_id %}update_instance_form{% endblock %} -{% block form_action %}{% url horizon:nova:instances:update instance_id %}{% endblock %} +{% block form_action %}{% url horizon:project:instances:update instance_id %}{% endblock %} {% block modal-header %}{% trans "Edit Instance" %}{% endblock %} @@ -20,5 +20,5 @@ {% block modal-footer %} - {% trans "Cancel" %} + {% trans "Cancel" %} {% endblock %} diff --git a/horizon/dashboards/nova/instances/templates/instances/detail.html b/horizon/dashboards/project/instances/templates/instances/detail.html similarity index 100% rename from horizon/dashboards/nova/instances/templates/instances/detail.html rename to horizon/dashboards/project/instances/templates/instances/detail.html diff --git a/horizon/dashboards/nova/instances/templates/instances/index.html b/horizon/dashboards/project/instances/templates/instances/index.html similarity index 100% rename from horizon/dashboards/nova/instances/templates/instances/index.html rename to horizon/dashboards/project/instances/templates/instances/index.html diff --git a/horizon/dashboards/nova/instances/templates/instances/launch.html b/horizon/dashboards/project/instances/templates/instances/launch.html similarity index 100% rename from horizon/dashboards/nova/instances/templates/instances/launch.html rename to horizon/dashboards/project/instances/templates/instances/launch.html diff --git a/horizon/dashboards/nova/instances/templates/instances/update.html b/horizon/dashboards/project/instances/templates/instances/update.html similarity index 84% rename from horizon/dashboards/nova/instances/templates/instances/update.html rename to horizon/dashboards/project/instances/templates/instances/update.html index 6ddff3a32..aba3dc9ab 100644 --- a/horizon/dashboards/nova/instances/templates/instances/update.html +++ b/horizon/dashboards/project/instances/templates/instances/update.html @@ -7,5 +7,5 @@ {% endblock page_header %} {% block main %} - {% include 'nova/instances/_update.html' %} + {% include 'project/instances/_update.html' %} {% endblock %} diff --git a/horizon/dashboards/nova/instances/tests.py b/horizon/dashboards/project/instances/tests.py similarity index 95% rename from horizon/dashboards/nova/instances/tests.py rename to horizon/dashboards/project/instances/tests.py index 57bbe6065..13d25c627 100644 --- a/horizon/dashboards/nova/instances/tests.py +++ b/horizon/dashboards/project/instances/tests.py @@ -23,7 +23,6 @@ from django.core.urlresolvers import reverse from django.utils.http import urlencode from django.utils.datastructures import SortedDict from mox import IsA, IgnoreArg -from copy import deepcopy from horizon import api from horizon import test @@ -32,7 +31,7 @@ from .tabs import InstanceDetailTabs from .workflows import LaunchInstance -INDEX_URL = reverse('horizon:nova:instances:index') +INDEX_URL = reverse('horizon:project:instances:index') class InstanceTests(test.TestCase): @@ -44,10 +43,10 @@ class InstanceTests(test.TestCase): self.mox.ReplayAll() res = self.client.get( - reverse('horizon:nova:instances:index')) + reverse('horizon:project:instances:index')) self.assertTemplateUsed(res, - 'nova/instances/index.html') + 'project/instances/index.html') instances = res.context['instances_table'].data self.assertItemsEqual(instances, self.servers.list()) @@ -58,9 +57,9 @@ class InstanceTests(test.TestCase): self.mox.ReplayAll() - res = self.client.get(reverse('horizon:nova:instances:index')) + res = self.client.get(reverse('horizon:project:instances:index')) - self.assertTemplateUsed(res, 'nova/instances/index.html') + self.assertTemplateUsed(res, 'project/instances/index.html') self.assertEqual(len(res.context['instances_table'].data), 0) self.assertMessageCount(res, error=1) @@ -78,9 +77,9 @@ class InstanceTests(test.TestCase): self.mox.ReplayAll() - res = self.client.get(reverse('horizon:nova:instances:index')) + res = self.client.get(reverse('horizon:project:instances:index')) - self.assertTemplateUsed(res, 'nova/instances/index.html') + self.assertTemplateUsed(res, 'project/instances/index.html') instances = res.context['instances_table'].data self.assertItemsEqual(instances, self.servers.list()) @@ -102,11 +101,11 @@ class InstanceTests(test.TestCase): self.mox.ReplayAll() - res = self.client.get(reverse('horizon:nova:instances:index')) + res = self.client.get(reverse('horizon:project:instances:index')) instances = res.context['instances_table'].data - self.assertTemplateUsed(res, 'nova/instances/index.html') + self.assertTemplateUsed(res, 'project/instances/index.html') self.assertMessageCount(res, error=len(servers)) self.assertItemsEqual(instances, self.servers.list()) @@ -342,7 +341,7 @@ class InstanceTests(test.TestCase): self.mox.ReplayAll() - url = reverse('horizon:nova:instances:detail', + url = reverse('horizon:project:instances:detail', args=[server.id]) res = self.client.get(url) @@ -366,7 +365,7 @@ class InstanceTests(test.TestCase): self.mox.ReplayAll() - url = reverse('horizon:nova:instances:detail', + url = reverse('horizon:project:instances:detail', args=[server.id]) res = self.client.get(url) @@ -393,7 +392,7 @@ class InstanceTests(test.TestCase): self.mox.ReplayAll() - url = reverse('horizon:nova:instances:detail', + url = reverse('horizon:project:instances:detail', args=[server.id]) tg = InstanceDetailTabs(self.request, instance=server) qs = "?%s=%s" % (tg.param_name, tg.get_tab("overview").get_id()) @@ -419,7 +418,7 @@ class InstanceTests(test.TestCase): self.mox.ReplayAll() - url = reverse('horizon:nova:instances:console', + url = reverse('horizon:project:instances:console', args=[server.id]) tg = InstanceDetailTabs(self.request, instance=server) qs = "?%s=%s" % (tg.param_name, tg.get_tab("log").get_id()) @@ -439,7 +438,7 @@ class InstanceTests(test.TestCase): self.mox.ReplayAll() - url = reverse('horizon:nova:instances:console', + url = reverse('horizon:project:instances:console', args=[server.id]) tg = InstanceDetailTabs(self.request, instance=server) qs = "?%s=%s" % (tg.param_name, tg.get_tab("log").get_id()) @@ -460,7 +459,7 @@ class InstanceTests(test.TestCase): api.server_vnc_console(IgnoreArg(), server.id).AndReturn(console_mock) self.mox.ReplayAll() - url = reverse('horizon:nova:instances:vnc', + url = reverse('horizon:project:instances:vnc', args=[server.id]) res = self.client.get(url) redirect = CONSOLE_OUTPUT + '&title=%s(1)' % server.name @@ -475,7 +474,7 @@ class InstanceTests(test.TestCase): self.mox.ReplayAll() - url = reverse('horizon:nova:instances:vnc', + url = reverse('horizon:project:instances:vnc', args=[server.id]) res = self.client.get(url) @@ -508,9 +507,9 @@ class InstanceTests(test.TestCase): formData = {'instance_id': server.id, 'method': 'CreateSnapshot', 'name': 'snapshot1'} - url = reverse('horizon:nova:images_and_snapshots:snapshots:create', + url = reverse('horizon:project:images_and_snapshots:snapshots:create', args=[server.id]) - redir_url = reverse('horizon:nova:images_and_snapshots:index') + redir_url = reverse('horizon:project:images_and_snapshots:index') res = self.client.post(url, formData) self.assertRedirects(res, redir_url) @@ -522,10 +521,10 @@ class InstanceTests(test.TestCase): self.mox.ReplayAll() - url = reverse('horizon:nova:instances:update', args=[server.id]) + url = reverse('horizon:project:instances:update', args=[server.id]) res = self.client.get(url) - self.assertTemplateUsed(res, 'nova/instances/update.html') + self.assertTemplateUsed(res, 'project/instances/update.html') @test.create_stubs({api: ('server_get',)}) def test_instance_update_get_server_get_exception(self): @@ -536,7 +535,7 @@ class InstanceTests(test.TestCase): self.mox.ReplayAll() - url = reverse('horizon:nova:instances:update', + url = reverse('horizon:project:instances:update', args=[server.id]) res = self.client.get(url) @@ -557,7 +556,7 @@ class InstanceTests(test.TestCase): 'instance': server.id, 'name': server.name, 'tenant_id': self.tenant.id} - url = reverse('horizon:nova:instances:update', + url = reverse('horizon:project:instances:update', args=[server.id]) res = self.client.post(url, formData) @@ -577,7 +576,7 @@ class InstanceTests(test.TestCase): 'instance': server.id, 'name': server.name, 'tenant_id': self.tenant.id} - url = reverse('horizon:nova:instances:update', + url = reverse('horizon:project:instances:update', args=[server.id]) res = self.client.post(url, formData) @@ -627,14 +626,14 @@ class InstanceTests(test.TestCase): self.mox.ReplayAll() - url = reverse('horizon:nova:instances:launch') + url = reverse('horizon:project:instances:launch') params = urlencode({"source_type": "image_id", "source_id": image.id}) res = self.client.get("%s?%s" % (url, params)) workflow = res.context['workflow'] self.assertTemplateUsed(res, - 'nova/instances/launch.html') + 'project/instances/launch.html') self.assertEqual(res.context['workflow'].name, LaunchInstance.name) step = workflow.get_step("setinstancedetailsaction") self.assertEqual(step.action.initial['image_id'], image.id) @@ -718,12 +717,11 @@ class InstanceTests(test.TestCase): 'device_name': device_name, 'network': self.networks.first().id, 'count': 1} - url = reverse('horizon:nova:instances:launch') + url = reverse('horizon:project:instances:launch') res = self.client.post(url, form_data) self.assertNoFormErrors(res) - self.assertRedirectsNoFollow(res, - reverse('horizon:nova:instances:index')) + self.assertRedirectsNoFollow(res, INDEX_URL) @test.create_stubs({api.glance: ('image_list_detailed',), api.quantum: ('network_list',), @@ -786,14 +784,14 @@ class InstanceTests(test.TestCase): 'volume_id': volume_choice, 'device_name': device_name, 'count': 1} - url = reverse('horizon:nova:instances:launch') + url = reverse('horizon:project:instances:launch') res = self.client.post(url, form_data) self.assertFormErrors(res, 1, 'There are no image sources available; ' 'you must first create an image before ' 'attempting to launch an instance.') self.assertTemplateUsed(res, - 'nova/instances/launch.html') + 'project/instances/launch.html') @test.create_stubs({api.glance: ('image_list_detailed',), api.quantum: ('network_list',), @@ -836,11 +834,11 @@ class InstanceTests(test.TestCase): self.mox.ReplayAll() - url = reverse('horizon:nova:instances:launch') + url = reverse('horizon:project:instances:launch') res = self.client.get(url) self.assertTemplateUsed(res, - 'nova/instances/launch.html') + 'project/instances/launch.html') @test.create_stubs({api.glance: ('image_list_detailed',), api.quantum: ('network_list',), @@ -907,7 +905,7 @@ class InstanceTests(test.TestCase): 'volume_type': '', 'network': self.networks.first().id, 'count': 1} - url = reverse('horizon:nova:instances:launch') + url = reverse('horizon:project:instances:launch') res = self.client.post(url, form_data) self.assertRedirectsNoFollow(res, INDEX_URL) @@ -976,7 +974,7 @@ class InstanceTests(test.TestCase): 'volume_id': volume_choice, 'device_name': device_name, 'count': 0} - url = reverse('horizon:nova:instances:launch') + url = reverse('horizon:project:instances:launch') res = self.client.post(url, form_data) self.assertContains(res, "greater than or equal to 1") diff --git a/horizon/dashboards/nova/instances/urls.py b/horizon/dashboards/project/instances/urls.py similarity index 95% rename from horizon/dashboards/nova/instances/urls.py rename to horizon/dashboards/project/instances/urls.py index f04009838..a777816ba 100644 --- a/horizon/dashboards/nova/instances/urls.py +++ b/horizon/dashboards/project/instances/urls.py @@ -26,7 +26,7 @@ from .views import IndexView, UpdateView, DetailView, LaunchInstanceView INSTANCES = r'^(?P[^/]+)/%s$' -urlpatterns = patterns('horizon.dashboards.nova.instances.views', +urlpatterns = patterns('horizon.dashboards.project.instances.views', url(r'^$', IndexView.as_view(), name='index'), url(r'^launch$', LaunchInstanceView.as_view(), name='launch'), url(r'^(?P[^/]+)/$', DetailView.as_view(), name='detail'), diff --git a/horizon/dashboards/nova/instances/views.py b/horizon/dashboards/project/instances/views.py similarity index 92% rename from horizon/dashboards/nova/instances/views.py rename to horizon/dashboards/project/instances/views.py index 1a3095219..1ee6626b2 100644 --- a/horizon/dashboards/nova/instances/views.py +++ b/horizon/dashboards/project/instances/views.py @@ -19,7 +19,7 @@ # under the License. """ -Views for managing Nova instances. +Views for managing instances. """ import logging @@ -46,7 +46,7 @@ LOG = logging.getLogger(__name__) class IndexView(tables.DataTableView): table_class = InstancesTable - template_name = 'nova/instances/index.html' + template_name = 'project/instances/index.html' def get_data(self): # Gather our instances @@ -85,7 +85,7 @@ class IndexView(tables.DataTableView): class LaunchInstanceView(workflows.WorkflowView): workflow_class = LaunchInstance - template_name = "nova/instances/launch.html" + template_name = "project/instances/launch.html" def get_initial(self): initial = super(LaunchInstanceView, self).get_initial() @@ -117,16 +117,16 @@ def vnc(request, instance_id): return shortcuts.redirect(console.url + ("&title=%s(%s)" % (instance.name, instance_id))) except: - redirect = reverse("horizon:nova:instances:index") + redirect = reverse("horizon:project:instances:index") msg = _('Unable to get VNC console for instance "%s".') % instance_id exceptions.handle(request, msg, redirect=redirect) class UpdateView(forms.ModalFormView): form_class = UpdateInstance - template_name = 'nova/instances/update.html' + template_name = 'project/instances/update.html' context_object_name = 'instance' - success_url = reverse_lazy("horizon:nova:instances:index") + success_url = reverse_lazy("horizon:project:instances:index") def get_context_data(self, **kwargs): context = super(UpdateView, self).get_context_data(**kwargs) @@ -139,7 +139,7 @@ class UpdateView(forms.ModalFormView): try: self._object = api.server_get(self.request, instance_id) except: - redirect = reverse("horizon:nova:instances:index") + redirect = reverse("horizon:project:instances:index") msg = _('Unable to retrieve instance details.') exceptions.handle(self.request, msg, redirect=redirect) return self._object @@ -152,7 +152,7 @@ class UpdateView(forms.ModalFormView): class DetailView(tabs.TabView): tab_group_class = InstanceDetailTabs - template_name = 'nova/instances/detail.html' + template_name = 'project/instances/detail.html' def get_context_data(self, **kwargs): context = super(DetailView, self).get_context_data(**kwargs) @@ -173,7 +173,7 @@ class DetailView(tabs.TabView): instance.security_groups = api.server_security_groups( self.request, instance_id) except: - redirect = reverse('horizon:nova:instances:index') + redirect = reverse('horizon:project:instances:index') exceptions.handle(self.request, _('Unable to retrieve details for ' 'instance "%s".') % instance_id, diff --git a/horizon/dashboards/nova/instances/workflows.py b/horizon/dashboards/project/instances/workflows.py similarity index 98% rename from horizon/dashboards/nova/instances/workflows.py rename to horizon/dashboards/project/instances/workflows.py index ef350eac8..4b0ca2c61 100644 --- a/horizon/dashboards/nova/instances/workflows.py +++ b/horizon/dashboards/project/instances/workflows.py @@ -88,7 +88,7 @@ class VolumeOptionsAction(workflows.Action): class Meta: name = _("Volume Options") permissions = ('openstack.services.volume',) - help_text_template = ("nova/instances/" + help_text_template = ("project/instances/" "_launch_volumes_help.html") def clean(self): @@ -182,7 +182,7 @@ class SetInstanceDetailsAction(workflows.Action): class Meta: name = _("Details") - help_text_template = ("nova/instances/" + help_text_template = ("project/instances/" "_launch_details_help.html") def clean(self): @@ -327,7 +327,7 @@ class SetInstanceDetails(workflows.Step): return context -KEYPAIR_IMPORT_URL = "horizon:nova:access_and_security:keypairs:import" +KEYPAIR_IMPORT_URL = "horizon:project:access_and_security:keypairs:import" class SetAccessControlsAction(workflows.Action): @@ -398,7 +398,7 @@ class CustomizeAction(workflows.Action): class Meta: name = _("Post-Creation") - help_text_template = ("nova/instances/" + help_text_template = ("project/instances/" "_launch_customize_help.html") @@ -454,7 +454,7 @@ class LaunchInstance(workflows.Workflow): finalize_button_name = _("Launch") success_message = _('Launched %(count)s named "%(name)s".') failure_message = _('Unable to launch %(count)s named "%(name)s".') - success_url = "horizon:nova:instances:index" + success_url = "horizon:project:instances:index" default_steps = (SelectProjectUser, SetInstanceDetails, SetAccessControls, diff --git a/horizon/dashboards/syspanel/models.py b/horizon/dashboards/project/models.py similarity index 100% rename from horizon/dashboards/syspanel/models.py rename to horizon/dashboards/project/models.py diff --git a/horizon/dashboards/syspanel/projects/__init__.py b/horizon/dashboards/project/networks/__init__.py similarity index 100% rename from horizon/dashboards/syspanel/projects/__init__.py rename to horizon/dashboards/project/networks/__init__.py diff --git a/horizon/dashboards/nova/networks/forms.py b/horizon/dashboards/project/networks/forms.py similarity index 97% rename from horizon/dashboards/nova/networks/forms.py rename to horizon/dashboards/project/networks/forms.py index 598ddd38e..ae1549649 100644 --- a/horizon/dashboards/nova/networks/forms.py +++ b/horizon/dashboards/project/networks/forms.py @@ -38,7 +38,7 @@ class UpdateNetwork(forms.SelfHandlingForm): network_id = forms.CharField(label=_("ID"), widget=forms.TextInput( attrs={'readonly': 'readonly'})) - failure_url = 'horizon:nova:networks:index' + failure_url = 'horizon:project:networks:index' def handle(self, request, data): try: diff --git a/horizon/dashboards/syspanel/networks/panel.py b/horizon/dashboards/project/networks/panel.py similarity index 90% rename from horizon/dashboards/syspanel/networks/panel.py rename to horizon/dashboards/project/networks/panel.py index 638c2bed1..4f312203a 100644 --- a/horizon/dashboards/syspanel/networks/panel.py +++ b/horizon/dashboards/project/networks/panel.py @@ -17,7 +17,7 @@ from django.utils.translation import ugettext_lazy as _ import horizon -from horizon.dashboards.syspanel import dashboard +from horizon.dashboards.project import dashboard class Networks(horizon.Panel): @@ -25,4 +25,4 @@ class Networks(horizon.Panel): slug = 'networks' permissions = ('openstack.services.network',) -dashboard.Syspanel.register(Networks) +dashboard.Project.register(Networks) diff --git a/horizon/dashboards/syspanel/quotas/__init__.py b/horizon/dashboards/project/networks/ports/__init__.py similarity index 100% rename from horizon/dashboards/syspanel/quotas/__init__.py rename to horizon/dashboards/project/networks/ports/__init__.py diff --git a/horizon/dashboards/nova/networks/ports/tables.py b/horizon/dashboards/project/networks/ports/tables.py similarity index 92% rename from horizon/dashboards/nova/networks/ports/tables.py rename to horizon/dashboards/project/networks/ports/tables.py index 0483d15ea..1cb6243b7 100644 --- a/horizon/dashboards/nova/networks/ports/tables.py +++ b/horizon/dashboards/project/networks/ports/tables.py @@ -26,7 +26,7 @@ LOG = logging.getLogger(__name__) def get_fixed_ips(port): - template_name = 'nova/networks/ports/_port_ips.html' + template_name = 'project/networks/ports/_port_ips.html' context = {"ips": port.fixed_ips} return template.loader.render_to_string(template_name, context) @@ -38,7 +38,7 @@ def get_attached(port): class PortsTable(tables.DataTable): name = tables.Column("name", verbose_name=_("Name"), - link="horizon:nova:networks:ports:detail") + link="horizon:project:networks:ports:detail") fixed_ips = tables.Column(get_fixed_ips, verbose_name=_("Fixed IPs")) attached = tables.Column(get_attached, verbose_name=_("Device Attached")) status = tables.Column("status", verbose_name=_("Status")) diff --git a/horizon/dashboards/nova/networks/ports/tabs.py b/horizon/dashboards/project/networks/ports/tabs.py similarity index 91% rename from horizon/dashboards/nova/networks/ports/tabs.py rename to horizon/dashboards/project/networks/ports/tabs.py index f4ebf2f4c..4c69241b3 100644 --- a/horizon/dashboards/nova/networks/ports/tabs.py +++ b/horizon/dashboards/project/networks/ports/tabs.py @@ -28,14 +28,14 @@ LOG = logging.getLogger(__name__) class OverviewTab(tabs.Tab): name = _("Overview") slug = "overview" - template_name = "nova/networks/ports/_detail_overview.html" + template_name = "project/networks/ports/_detail_overview.html" def get_context_data(self, request): port_id = self.tab_group.kwargs['port_id'] try: port = api.quantum.port_get(self.request, port_id) except: - redirect = reverse('horizon:nova:networks:index') + redirect = reverse('horizon:project:networks:index') msg = _('Unable to retrieve port details.') exceptions.handle(request, msg, redirect=redirect) return {'port': port} diff --git a/horizon/dashboards/nova/networks/ports/urls.py b/horizon/dashboards/project/networks/ports/urls.py similarity index 91% rename from horizon/dashboards/nova/networks/ports/urls.py rename to horizon/dashboards/project/networks/ports/urls.py index 67fab5479..42cd8a873 100644 --- a/horizon/dashboards/nova/networks/ports/urls.py +++ b/horizon/dashboards/project/networks/ports/urls.py @@ -20,5 +20,5 @@ from .views import DetailView PORTS = r'^(?P[^/]+)/%s$' -urlpatterns = patterns('horizon.dashboards.nova.networks.ports.views', +urlpatterns = patterns('horizon.dashboards.project.networks.ports.views', url(PORTS % 'detail', DetailView.as_view(), name='detail')) diff --git a/horizon/dashboards/nova/networks/ports/views.py b/horizon/dashboards/project/networks/ports/views.py similarity index 93% rename from horizon/dashboards/nova/networks/ports/views.py rename to horizon/dashboards/project/networks/ports/views.py index 17fc43544..d728eff47 100644 --- a/horizon/dashboards/nova/networks/ports/views.py +++ b/horizon/dashboards/project/networks/ports/views.py @@ -25,4 +25,4 @@ LOG = logging.getLogger(__name__) class DetailView(tabs.TabView): tab_group_class = PortDetailTabs - template_name = 'nova/networks/ports/detail.html' + template_name = 'project/networks/ports/detail.html' diff --git a/horizon/dashboards/syspanel/services/__init__.py b/horizon/dashboards/project/networks/subnets/__init__.py similarity index 100% rename from horizon/dashboards/syspanel/services/__init__.py rename to horizon/dashboards/project/networks/subnets/__init__.py diff --git a/horizon/dashboards/nova/networks/subnets/forms.py b/horizon/dashboards/project/networks/subnets/forms.py similarity index 98% rename from horizon/dashboards/nova/networks/subnets/forms.py rename to horizon/dashboards/project/networks/subnets/forms.py index 111db3664..0aae396e8 100644 --- a/horizon/dashboards/nova/networks/subnets/forms.py +++ b/horizon/dashboards/project/networks/subnets/forms.py @@ -57,7 +57,7 @@ class CreateSubnet(forms.SelfHandlingForm): "(e.g. 192.168.0.1)"), version=fields.IPv4 | fields.IPv6, mask=False) - failure_url = 'horizon:nova:networks:detail' + failure_url = 'horizon:project:networks:detail' def clean(self): cleaned_data = super(CreateSubnet, self).clean() @@ -107,7 +107,7 @@ class UpdateSubnet(forms.SelfHandlingForm): "(e.g. 192.168.0.1)"), version=fields.IPv4 | fields.IPv6, mask=False) - failure_url = 'horizon:nova:networks:detail' + failure_url = 'horizon:project:networks:detail' def clean(self): cleaned_data = super(UpdateSubnet, self).clean() diff --git a/horizon/dashboards/nova/networks/subnets/tables.py b/horizon/dashboards/project/networks/subnets/tables.py similarity index 92% rename from horizon/dashboards/nova/networks/subnets/tables.py rename to horizon/dashboards/project/networks/subnets/tables.py index 02b544fd1..ac435bab8 100644 --- a/horizon/dashboards/nova/networks/subnets/tables.py +++ b/horizon/dashboards/project/networks/subnets/tables.py @@ -50,7 +50,7 @@ class DeleteSubnet(CheckNetworkEditable, tables.DeleteAction): msg = _('Failed to delete subnet %s') % obj_id LOG.info(msg) network_id = self.table.kwargs['network_id'] - redirect = reverse('horizon:nova:networks:detail', + redirect = reverse('horizon:project:networks:detail', args=[network_id]) exceptions.handle(request, msg, redirect=redirect) @@ -58,7 +58,7 @@ class DeleteSubnet(CheckNetworkEditable, tables.DeleteAction): class CreateSubnet(CheckNetworkEditable, tables.LinkAction): name = "create" verbose_name = _("Create Subnet") - url = "horizon:nova:networks:addsubnet" + url = "horizon:project:networks:addsubnet" classes = ("ajax-modal", "btn-create") def get_link_url(self, datum=None): @@ -69,7 +69,7 @@ class CreateSubnet(CheckNetworkEditable, tables.LinkAction): class UpdateSubnet(CheckNetworkEditable, tables.LinkAction): name = "update" verbose_name = _("Edit Subnet") - url = "horizon:nova:networks:editsubnet" + url = "horizon:project:networks:editsubnet" classes = ("ajax-modal", "btn-edit") def get_link_url(self, subnet): @@ -79,11 +79,11 @@ class UpdateSubnet(CheckNetworkEditable, tables.LinkAction): class SubnetsTable(tables.DataTable): name = tables.Column("name", verbose_name=_("Name"), - link='horizon:nova:networks:subnets:detail') + link='horizon:project:networks:subnets:detail') cidr = tables.Column("cidr", verbose_name=_("Network Address")) ip_version = tables.Column("ipver_str", verbose_name=_("IP Version")) gateway_ip = tables.Column("gateway_ip", verbose_name=_("Gateway IP")) - failure_url = reverse_lazy('horizon:nova:networks:index') + failure_url = reverse_lazy('horizon:project:networks:index') def _get_network(self): if not hasattr(self, "_network"): diff --git a/horizon/dashboards/nova/networks/subnets/tabs.py b/horizon/dashboards/project/networks/subnets/tabs.py similarity index 91% rename from horizon/dashboards/nova/networks/subnets/tabs.py rename to horizon/dashboards/project/networks/subnets/tabs.py index c832fba6b..872784037 100644 --- a/horizon/dashboards/nova/networks/subnets/tabs.py +++ b/horizon/dashboards/project/networks/subnets/tabs.py @@ -30,14 +30,14 @@ LOG = logging.getLogger(__name__) class OverviewTab(tabs.Tab): name = _("Overview") slug = "overview" - template_name = "nova/networks/subnets/_detail_overview.html" + template_name = "project/networks/subnets/_detail_overview.html" def get_context_data(self, request): subnet_id = self.tab_group.kwargs['subnet_id'] try: subnet = api.quantum.subnet_get(self.request, subnet_id) except: - redirect = reverse('horizon:nova:networks:index') + redirect = reverse('horizon:project:networks:index') msg = _('Unable to retrieve subnet details.') exceptions.handle(request, msg, redirect=redirect) return {'subnet': subnet} diff --git a/horizon/dashboards/nova/networks/subnets/urls.py b/horizon/dashboards/project/networks/subnets/urls.py similarity index 91% rename from horizon/dashboards/nova/networks/subnets/urls.py rename to horizon/dashboards/project/networks/subnets/urls.py index 9e4523f2a..15dc326f0 100644 --- a/horizon/dashboards/nova/networks/subnets/urls.py +++ b/horizon/dashboards/project/networks/subnets/urls.py @@ -20,5 +20,5 @@ from .views import DetailView SUBNETS = r'^(?P[^/]+)/%s$' -urlpatterns = patterns('horizon.dashboards.nova.networks.subnets.views', +urlpatterns = patterns('horizon.dashboards.project.networks.subnets.views', url(SUBNETS % 'detail', DetailView.as_view(), name='detail')) diff --git a/horizon/dashboards/nova/networks/subnets/views.py b/horizon/dashboards/project/networks/subnets/views.py similarity index 87% rename from horizon/dashboards/nova/networks/subnets/views.py rename to horizon/dashboards/project/networks/subnets/views.py index d773beca8..21959a463 100644 --- a/horizon/dashboards/nova/networks/subnets/views.py +++ b/horizon/dashboards/project/networks/subnets/views.py @@ -34,8 +34,8 @@ LOG = logging.getLogger(__name__) class CreateView(forms.ModalFormView): form_class = CreateSubnet - template_name = 'nova/networks/subnets/create.html' - success_url = 'horizon:nova:networks:detail' + template_name = 'project/networks/subnets/create.html' + success_url = 'horizon:project:networks:detail' def get_success_url(self): return reverse(self.success_url, @@ -48,7 +48,7 @@ class CreateView(forms.ModalFormView): self._object = api.quantum.network_get(self.request, network_id) except: - redirect = reverse('horizon:nova:networks:index') + redirect = reverse('horizon:project:networks:index') msg = _("Unable to retrieve network.") exceptions.handle(self.request, msg, redirect=redirect) return self._object @@ -66,12 +66,12 @@ class CreateView(forms.ModalFormView): class UpdateView(forms.ModalFormView): form_class = UpdateSubnet - template_name = 'nova/networks/subnets/update.html' + template_name = 'project/networks/subnets/update.html' context_object_name = 'subnet' - success_url = reverse_lazy('horizon:nova:networks:detail') + success_url = reverse_lazy('horizon:project:networks:detail') def get_success_url(self): - return reverse('horizon:nova:networks:detail', + return reverse('horizon:project:networks:detail', args=(self.kwargs['network_id'],)) def _get_object(self, *args, **kwargs): @@ -80,7 +80,7 @@ class UpdateView(forms.ModalFormView): try: self._object = api.quantum.subnet_get(self.request, subnet_id) except: - redirect = reverse("horizon:nova:networks:index") + redirect = reverse("horizon:project:networks:index") msg = _('Unable to retrieve subnet details') exceptions.handle(self.request, msg, redirect=redirect) return self._object @@ -106,4 +106,4 @@ class UpdateView(forms.ModalFormView): class DetailView(tabs.TabView): tab_group_class = SubnetDetailTabs - template_name = 'nova/networks/subnets/detail.html' + template_name = 'project/networks/subnets/detail.html' diff --git a/horizon/dashboards/nova/networks/tables.py b/horizon/dashboards/project/networks/tables.py similarity index 91% rename from horizon/dashboards/nova/networks/tables.py rename to horizon/dashboards/project/networks/tables.py index 92ea02a60..dd356f996 100644 --- a/horizon/dashboards/nova/networks/tables.py +++ b/horizon/dashboards/project/networks/tables.py @@ -57,33 +57,33 @@ class DeleteNetwork(CheckNetworkEditable, tables.DeleteAction): except: msg = _('Failed to delete network %s') % network_id LOG.info(msg) - redirect = reverse("horizon:nova:networks:index") + redirect = reverse("horizon:project:networks:index") exceptions.handle(request, msg, redirect=redirect) class CreateNetwork(tables.LinkAction): name = "create" verbose_name = _("Create Network") - url = "horizon:nova:networks:create" + url = "horizon:project:networks:create" classes = ("ajax-modal", "btn-create") class EditNetwork(CheckNetworkEditable, tables.LinkAction): name = "update" verbose_name = _("Edit Network") - url = "horizon:nova:networks:update" + url = "horizon:project:networks:update" classes = ("ajax-modal", "btn-edit") class CreateSubnet(CheckNetworkEditable, tables.LinkAction): name = "subnet" verbose_name = _("Add Subnet") - url = "horizon:nova:networks:addsubnet" + url = "horizon:project:networks:addsubnet" classes = ("ajax-modal", "btn-create") def get_subnets(network): - template_name = 'nova/networks/_network_ips.html' + template_name = 'project/networks/_network_ips.html' context = {"subnets": network.subnets} return template.loader.render_to_string(template_name, context) @@ -91,7 +91,7 @@ def get_subnets(network): class NetworksTable(tables.DataTable): name = tables.Column("name", verbose_name=_("Name"), - link='horizon:nova:networks:detail') + link='horizon:project:networks:detail') subnets = tables.Column(get_subnets, verbose_name=_("Subnets Associated"),) shared = tables.Column("shared", verbose_name=_("Shared"), diff --git a/horizon/dashboards/nova/networks/templates/networks/_create.html b/horizon/dashboards/project/networks/templates/networks/_create.html similarity index 75% rename from horizon/dashboards/nova/networks/templates/networks/_create.html rename to horizon/dashboards/project/networks/templates/networks/_create.html index 664a6b99a..aeb53650b 100644 --- a/horizon/dashboards/nova/networks/templates/networks/_create.html +++ b/horizon/dashboards/project/networks/templates/networks/_create.html @@ -2,7 +2,7 @@ {% load i18n %} {% block form_id %}create_network_form{% endblock %} -{% block form_action %}{% url horizon:nova:networks:create %}{% endblock %} +{% block form_action %}{% url horizon:project:networks:create %}{% endblock %} {% block modal-header %}{% trans "Create Network" %}{% endblock %} @@ -20,5 +20,5 @@ {% block modal-footer %} - {% trans "Cancel" %} + {% trans "Cancel" %} {% endblock %} diff --git a/horizon/dashboards/nova/networks/templates/networks/_detail_overview.html b/horizon/dashboards/project/networks/templates/networks/_detail_overview.html similarity index 100% rename from horizon/dashboards/nova/networks/templates/networks/_detail_overview.html rename to horizon/dashboards/project/networks/templates/networks/_detail_overview.html diff --git a/horizon/dashboards/nova/networks/templates/networks/_network_ips.html b/horizon/dashboards/project/networks/templates/networks/_network_ips.html similarity index 100% rename from horizon/dashboards/nova/networks/templates/networks/_network_ips.html rename to horizon/dashboards/project/networks/templates/networks/_network_ips.html diff --git a/horizon/dashboards/syspanel/networks/templates/networks/_update.html b/horizon/dashboards/project/networks/templates/networks/_update.html similarity index 75% rename from horizon/dashboards/syspanel/networks/templates/networks/_update.html rename to horizon/dashboards/project/networks/templates/networks/_update.html index 63d5c2fba..9638dff87 100644 --- a/horizon/dashboards/syspanel/networks/templates/networks/_update.html +++ b/horizon/dashboards/project/networks/templates/networks/_update.html @@ -2,7 +2,7 @@ {% load i18n %} {% block form_id %}update_network_form{% endblock %} -{% block form_action %}{% url horizon:syspanel:networks:update network_id %}{% endblock %} +{% block form_action %}{% url horizon:project:networks:update network_id %}{% endblock %} {% block modal-header %}{% trans "Edit Network" %}{% endblock %} @@ -20,5 +20,5 @@ {% block modal-footer %} - {% trans "Cancel" %} + {% trans "Cancel" %} {% endblock %} diff --git a/horizon/dashboards/nova/networks/templates/networks/create.html b/horizon/dashboards/project/networks/templates/networks/create.html similarity index 100% rename from horizon/dashboards/nova/networks/templates/networks/create.html rename to horizon/dashboards/project/networks/templates/networks/create.html diff --git a/horizon/dashboards/nova/networks/templates/networks/detail.html b/horizon/dashboards/project/networks/templates/networks/detail.html similarity index 87% rename from horizon/dashboards/nova/networks/templates/networks/detail.html rename to horizon/dashboards/project/networks/templates/networks/detail.html index 3a8ac2d87..d6773feb0 100644 --- a/horizon/dashboards/nova/networks/templates/networks/detail.html +++ b/horizon/dashboards/project/networks/templates/networks/detail.html @@ -7,7 +7,7 @@ {% endblock page_header %} {% block main %} - {% include "nova/networks/_detail_overview.html" %} + {% include "project/networks/_detail_overview.html" %}
{{ subnets_table.render }} diff --git a/horizon/dashboards/nova/networks/templates/networks/index.html b/horizon/dashboards/project/networks/templates/networks/index.html similarity index 100% rename from horizon/dashboards/nova/networks/templates/networks/index.html rename to horizon/dashboards/project/networks/templates/networks/index.html diff --git a/horizon/dashboards/nova/networks/templates/networks/ports/_detail_overview.html b/horizon/dashboards/project/networks/templates/networks/ports/_detail_overview.html similarity index 100% rename from horizon/dashboards/nova/networks/templates/networks/ports/_detail_overview.html rename to horizon/dashboards/project/networks/templates/networks/ports/_detail_overview.html diff --git a/horizon/dashboards/nova/networks/templates/networks/ports/_port_ips.html b/horizon/dashboards/project/networks/templates/networks/ports/_port_ips.html similarity index 100% rename from horizon/dashboards/nova/networks/templates/networks/ports/_port_ips.html rename to horizon/dashboards/project/networks/templates/networks/ports/_port_ips.html diff --git a/horizon/dashboards/nova/networks/templates/networks/ports/detail.html b/horizon/dashboards/project/networks/templates/networks/ports/detail.html similarity index 100% rename from horizon/dashboards/nova/networks/templates/networks/ports/detail.html rename to horizon/dashboards/project/networks/templates/networks/ports/detail.html diff --git a/horizon/dashboards/nova/networks/templates/networks/subnets/_create.html b/horizon/dashboards/project/networks/templates/networks/subnets/_create.html similarity index 79% rename from horizon/dashboards/nova/networks/templates/networks/subnets/_create.html rename to horizon/dashboards/project/networks/templates/networks/subnets/_create.html index 942ece067..cd4ebbc1c 100644 --- a/horizon/dashboards/nova/networks/templates/networks/subnets/_create.html +++ b/horizon/dashboards/project/networks/templates/networks/subnets/_create.html @@ -2,7 +2,7 @@ {% load i18n %} {% block form_id %}create_subnet_form{% endblock %} -{% block form_action %}{% url horizon:nova:networks:addsubnet network.id %} +{% block form_action %}{% url horizon:project:networks:addsubnet network.id %} {% endblock %} {% block modal-header %}{% trans "Create Subnet" %}{% endblock %} @@ -21,5 +21,5 @@ {% block modal-footer %} - {% trans "Cancel" %} + {% trans "Cancel" %} {% endblock %} diff --git a/horizon/dashboards/nova/networks/templates/networks/subnets/_detail_overview.html b/horizon/dashboards/project/networks/templates/networks/subnets/_detail_overview.html similarity index 100% rename from horizon/dashboards/nova/networks/templates/networks/subnets/_detail_overview.html rename to horizon/dashboards/project/networks/templates/networks/subnets/_detail_overview.html diff --git a/horizon/dashboards/nova/networks/templates/networks/subnets/_update.html b/horizon/dashboards/project/networks/templates/networks/subnets/_update.html similarity index 78% rename from horizon/dashboards/nova/networks/templates/networks/subnets/_update.html rename to horizon/dashboards/project/networks/templates/networks/subnets/_update.html index 4093b06c7..f74b5e280 100644 --- a/horizon/dashboards/nova/networks/templates/networks/subnets/_update.html +++ b/horizon/dashboards/project/networks/templates/networks/subnets/_update.html @@ -2,7 +2,7 @@ {% load i18n %} {% block form_id %}update_subnet_form{% endblock %} -{% block form_action %}{% url horizon:nova:networks:editsubnet network_id subnet_id %}{% endblock %} +{% block form_action %}{% url horizon:project:networks:editsubnet network_id subnet_id %}{% endblock %} {% block modal-header %}{% trans "Edit Subnet" %}{% endblock %} @@ -29,5 +29,5 @@ {% block modal-footer %} - {% trans "Cancel" %} + {% trans "Cancel" %} {% endblock %} diff --git a/horizon/dashboards/syspanel/networks/templates/networks/subnets/create.html b/horizon/dashboards/project/networks/templates/networks/subnets/create.html similarity index 82% rename from horizon/dashboards/syspanel/networks/templates/networks/subnets/create.html rename to horizon/dashboards/project/networks/templates/networks/subnets/create.html index 59bd53050..7a614b1b8 100644 --- a/horizon/dashboards/syspanel/networks/templates/networks/subnets/create.html +++ b/horizon/dashboards/project/networks/templates/networks/subnets/create.html @@ -7,5 +7,5 @@ {% endblock page_header %} {% block main %} - {% include "syspanel/networks/subnets/_create.html" %} + {% include "project/networks/subnets/_create.html" %} {% endblock %} diff --git a/horizon/dashboards/nova/networks/templates/networks/subnets/detail.html b/horizon/dashboards/project/networks/templates/networks/subnets/detail.html similarity index 100% rename from horizon/dashboards/nova/networks/templates/networks/subnets/detail.html rename to horizon/dashboards/project/networks/templates/networks/subnets/detail.html diff --git a/horizon/dashboards/nova/networks/templates/networks/subnets/index.html b/horizon/dashboards/project/networks/templates/networks/subnets/index.html similarity index 100% rename from horizon/dashboards/nova/networks/templates/networks/subnets/index.html rename to horizon/dashboards/project/networks/templates/networks/subnets/index.html diff --git a/horizon/dashboards/syspanel/networks/templates/networks/subnets/update.html b/horizon/dashboards/project/networks/templates/networks/subnets/update.html similarity index 82% rename from horizon/dashboards/syspanel/networks/templates/networks/subnets/update.html rename to horizon/dashboards/project/networks/templates/networks/subnets/update.html index 92dbff0c7..1d74569d6 100644 --- a/horizon/dashboards/syspanel/networks/templates/networks/subnets/update.html +++ b/horizon/dashboards/project/networks/templates/networks/subnets/update.html @@ -7,5 +7,5 @@ {% endblock page_header %} {% block main %} - {% include 'syspanel/networks/subnets/_update.html' %} + {% include 'project/networks/subnets/_update.html' %} {% endblock %} diff --git a/horizon/dashboards/syspanel/networks/templates/networks/update.html b/horizon/dashboards/project/networks/templates/networks/update.html similarity index 84% rename from horizon/dashboards/syspanel/networks/templates/networks/update.html rename to horizon/dashboards/project/networks/templates/networks/update.html index 9870a3652..07f5993f7 100644 --- a/horizon/dashboards/syspanel/networks/templates/networks/update.html +++ b/horizon/dashboards/project/networks/templates/networks/update.html @@ -7,5 +7,5 @@ {% endblock page_header %} {% block main %} - {% include 'syspanel/networks/_update.html' %} + {% include 'project/networks/_update.html' %} {% endblock %} diff --git a/horizon/dashboards/nova/networks/tests.py b/horizon/dashboards/project/networks/tests.py similarity index 90% rename from horizon/dashboards/nova/networks/tests.py rename to horizon/dashboards/project/networks/tests.py index 40e17569a..3e0db4ee1 100644 --- a/horizon/dashboards/nova/networks/tests.py +++ b/horizon/dashboards/project/networks/tests.py @@ -16,11 +16,8 @@ from django import http from django.core.urlresolvers import reverse -from django.utils.http import urlencode from django.utils.html import escape -from django.utils.datastructures import SortedDict -from mox import IsA, IgnoreArg -from copy import deepcopy +from mox import IsA from horizon import api from horizon import test @@ -28,7 +25,7 @@ from horizon import test from .workflows import CreateNetwork -INDEX_URL = reverse('horizon:nova:networks:index') +INDEX_URL = reverse('horizon:project:networks:index') class NetworkTests(test.TestCase): @@ -46,7 +43,7 @@ class NetworkTests(test.TestCase): res = self.client.get(INDEX_URL) - self.assertTemplateUsed(res, 'nova/networks/index.html') + self.assertTemplateUsed(res, 'project/networks/index.html') networks = res.context['networks_table'].data self.assertItemsEqual(networks, self.networks.list()) @@ -60,7 +57,7 @@ class NetworkTests(test.TestCase): res = self.client.get(INDEX_URL) - self.assertTemplateUsed(res, 'nova/networks/index.html') + self.assertTemplateUsed(res, 'project/networks/index.html') self.assertEqual(len(res.context['networks_table'].data), 0) self.assertMessageCount(res, error=1) @@ -80,10 +77,10 @@ class NetworkTests(test.TestCase): self.mox.ReplayAll() - res = self.client.get(reverse('horizon:nova:networks:detail', + res = self.client.get(reverse('horizon:project:networks:detail', args=[network_id])) - self.assertTemplateUsed(res, 'nova/networks/detail.html') + self.assertTemplateUsed(res, 'project/networks/detail.html') subnets = res.context['subnets_table'].data ports = res.context['ports_table'].data self.assertItemsEqual(subnets, [self.subnets.first()]) @@ -98,7 +95,7 @@ class NetworkTests(test.TestCase): .AndRaise(self.exceptions.quantum) self.mox.ReplayAll() - url = reverse('horizon:nova:networks:detail', args=[network_id]) + url = reverse('horizon:project:networks:detail', args=[network_id]) res = self.client.get(url) redir_url = INDEX_URL @@ -121,10 +118,10 @@ class NetworkTests(test.TestCase): self.mox.ReplayAll() - res = self.client.get(reverse('horizon:nova:networks:detail', + res = self.client.get(reverse('horizon:project:networks:detail', args=[network_id])) - self.assertTemplateUsed(res, 'nova/networks/detail.html') + self.assertTemplateUsed(res, 'project/networks/detail.html') subnets = res.context['subnets_table'].data ports = res.context['ports_table'].data self.assertEqual(len(subnets), 0) @@ -147,10 +144,10 @@ class NetworkTests(test.TestCase): self.mox.ReplayAll() - res = self.client.get(reverse('horizon:nova:networks:detail', + res = self.client.get(reverse('horizon:project:networks:detail', args=[network_id])) - self.assertTemplateUsed(res, 'nova/networks/detail.html') + self.assertTemplateUsed(res, 'project/networks/detail.html') subnets = res.context['subnets_table'].data ports = res.context['ports_table'].data self.assertItemsEqual(subnets, [self.subnets.first()]) @@ -160,11 +157,11 @@ class NetworkTests(test.TestCase): # no api methods are called. self.mox.ReplayAll() - url = reverse('horizon:nova:networks:create') + url = reverse('horizon:project:networks:create') res = self.client.get(url) workflow = res.context['workflow'] - self.assertTemplateUsed(res, 'nova/networks/create.html') + self.assertTemplateUsed(res, 'project/networks/create.html') self.assertEqual(workflow.name, CreateNetwork.name) expected_objs = ['', ''] @@ -183,7 +180,7 @@ class NetworkTests(test.TestCase): 'cidr': '', 'ip_version': 4, 'gateway_ip': ''} - url = reverse('horizon:nova:networks:create') + url = reverse('horizon:project:networks:create') res = self.client.post(url, form_data) self.assertNoFormErrors(res) @@ -211,7 +208,7 @@ class NetworkTests(test.TestCase): 'cidr': subnet.cidr, 'ip_version': subnet.ip_version, 'gateway_ip': subnet.gateway_ip} - url = reverse('horizon:nova:networks:create') + url = reverse('horizon:project:networks:create') res = self.client.post(url, form_data) self.assertNoFormErrors(res) @@ -230,7 +227,7 @@ class NetworkTests(test.TestCase): 'cidr': '', 'ip_version': 4, 'gateway_ip': ''} - url = reverse('horizon:nova:networks:create') + url = reverse('horizon:project:networks:create') res = self.client.post(url, form_data) self.assertNoFormErrors(res) @@ -250,7 +247,7 @@ class NetworkTests(test.TestCase): 'cidr': subnet.cidr, 'ip_version': subnet.ip_version, 'gateway_ip': subnet.gateway_ip} - url = reverse('horizon:nova:networks:create') + url = reverse('horizon:project:networks:create') res = self.client.post(url, form_data) self.assertNoFormErrors(res) @@ -278,7 +275,7 @@ class NetworkTests(test.TestCase): 'cidr': subnet.cidr, 'ip_version': subnet.ip_version, 'gateway_ip': subnet.gateway_ip} - url = reverse('horizon:nova:networks:create') + url = reverse('horizon:project:networks:create') res = self.client.post(url, form_data) self.assertNoFormErrors(res) @@ -295,7 +292,7 @@ class NetworkTests(test.TestCase): 'cidr': '', 'ip_version': subnet.ip_version, 'gateway_ip': subnet.gateway_ip} - url = reverse('horizon:nova:networks:create') + url = reverse('horizon:project:networks:create') res = self.client.post(url, form_data) self.assertContains(res, escape('Specify "Network Address" or ' @@ -314,7 +311,7 @@ class NetworkTests(test.TestCase): 'cidr': cidr, 'ip_version': subnet.ip_version, 'gateway_ip': subnet.gateway_ip} - url = reverse('horizon:nova:networks:create') + url = reverse('horizon:project:networks:create') res = self.client.post(url, form_data) expected_msg = 'Network Address and IP version are inconsistent.' @@ -333,7 +330,7 @@ class NetworkTests(test.TestCase): 'cidr': subnet.cidr, 'ip_version': subnet.ip_version, 'gateway_ip': gateway_ip} - url = reverse('horizon:nova:networks:create') + url = reverse('horizon:project:networks:create') res = self.client.post(url, form_data) self.assertContains(res, 'Gateway IP and IP version are inconsistent.') @@ -346,10 +343,10 @@ class NetworkTests(test.TestCase): self.mox.ReplayAll() - url = reverse('horizon:nova:networks:update', args=[network.id]) + url = reverse('horizon:project:networks:update', args=[network.id]) res = self.client.get(url) - self.assertTemplateUsed(res, 'nova/networks/update.html') + self.assertTemplateUsed(res, 'project/networks/update.html') @test.create_stubs({api.quantum: ('network_get',)}) def test_network_update_get_exception(self): @@ -359,7 +356,7 @@ class NetworkTests(test.TestCase): self.mox.ReplayAll() - url = reverse('horizon:nova:networks:update', args=[network.id]) + url = reverse('horizon:project:networks:update', args=[network.id]) res = self.client.get(url) redir_url = INDEX_URL @@ -379,7 +376,7 @@ class NetworkTests(test.TestCase): formData = {'network_id': network.id, 'name': network.name, 'tenant_id': network.tenant_id} - url = reverse('horizon:nova:networks:update', args=[network.id]) + url = reverse('horizon:project:networks:update', args=[network.id]) res = self.client.post(url, formData) self.assertRedirectsNoFollow(res, INDEX_URL) @@ -398,7 +395,7 @@ class NetworkTests(test.TestCase): form_data = {'network_id': network.id, 'name': network.name, 'tenant_id': network.tenant_id} - url = reverse('horizon:nova:networks:update', args=[network.id]) + url = reverse('horizon:project:networks:update', args=[network.id]) res = self.client.post(url, form_data) self.assertRedirectsNoFollow(res, INDEX_URL) @@ -486,10 +483,11 @@ class NetworkTests(test.TestCase): self.mox.ReplayAll() - res = self.client.get(reverse('horizon:nova:networks:subnets:detail', - args=[subnet.id])) + url = reverse('horizon:project:networks:subnets:detail', + args=[subnet.id]) + res = self.client.get(url) - self.assertTemplateUsed(res, 'nova/networks/subnets/detail.html') + self.assertTemplateUsed(res, 'project/networks/subnets/detail.html') self.assertEqual(res.context['subnet'].id, subnet.id) @test.create_stubs({api.quantum: ('subnet_get',)}) @@ -500,8 +498,9 @@ class NetworkTests(test.TestCase): self.mox.ReplayAll() - res = self.client.get(reverse('horizon:nova:networks:subnets:detail', - args=[subnet.id])) + url = reverse('horizon:project:networks:subnets:detail', + args=[subnet.id]) + res = self.client.get(url) self.assertRedirectsNoFollow(res, INDEX_URL) @@ -513,11 +512,11 @@ class NetworkTests(test.TestCase): .AndReturn(self.networks.first()) self.mox.ReplayAll() - url = reverse('horizon:nova:networks:addsubnet', + url = reverse('horizon:project:networks:addsubnet', args=[network.id]) res = self.client.get(url) - self.assertTemplateUsed(res, 'nova/networks/subnets/create.html') + self.assertTemplateUsed(res, 'project/networks/subnets/create.html') @test.create_stubs({api.quantum: ('network_get', 'subnet_create',)}) @@ -543,12 +542,12 @@ class NetworkTests(test.TestCase): 'cidr': subnet.cidr, 'ip_version': subnet.ip_version, 'gateway_ip': subnet.gateway_ip} - url = reverse('horizon:nova:networks:addsubnet', + url = reverse('horizon:project:networks:addsubnet', args=[subnet.network_id]) res = self.client.post(url, form_data) self.assertNoFormErrors(res) - redir_url = reverse('horizon:nova:networks:detail', + redir_url = reverse('horizon:project:networks:detail', args=[subnet.network_id]) self.assertRedirectsNoFollow(res, redir_url) @@ -568,7 +567,7 @@ class NetworkTests(test.TestCase): 'cidr': subnet.cidr, 'ip_version': subnet.ip_version, 'gateway_ip': subnet.gateway_ip} - url = reverse('horizon:nova:networks:addsubnet', + url = reverse('horizon:project:networks:addsubnet', args=[subnet.network_id]) res = self.client.post(url, form_data) @@ -599,11 +598,11 @@ class NetworkTests(test.TestCase): 'cidr': subnet.cidr, 'ip_version': subnet.ip_version, 'gateway_ip': subnet.gateway_ip} - url = reverse('horizon:nova:networks:addsubnet', + url = reverse('horizon:project:networks:addsubnet', args=[subnet.network_id]) res = self.client.post(url, form_data) - redir_url = reverse('horizon:nova:networks:detail', + redir_url = reverse('horizon:project:networks:detail', args=[subnet.network_id]) self.assertRedirectsNoFollow(res, redir_url) @@ -624,7 +623,7 @@ class NetworkTests(test.TestCase): 'cidr': cidr, 'ip_version': subnet.ip_version, 'gateway_ip': subnet.gateway_ip} - url = reverse('horizon:nova:networks:addsubnet', + url = reverse('horizon:project:networks:addsubnet', args=[subnet.network_id]) res = self.client.post(url, form_data) @@ -648,7 +647,7 @@ class NetworkTests(test.TestCase): 'cidr': subnet.cidr, 'ip_version': subnet.ip_version, 'gateway_ip': gateway_ip} - url = reverse('horizon:nova:networks:addsubnet', + url = reverse('horizon:project:networks:addsubnet', args=[subnet.network_id]) res = self.client.post(url, form_data) @@ -672,11 +671,11 @@ class NetworkTests(test.TestCase): 'cidr': subnet.cidr, 'ip_version': subnet.ip_version, 'gateway_ip': subnet.gateway_ip} - url = reverse('horizon:nova:networks:editsubnet', + url = reverse('horizon:project:networks:editsubnet', args=[subnet.network_id, subnet.id]) res = self.client.post(url, formData) - redir_url = reverse('horizon:nova:networks:detail', + redir_url = reverse('horizon:project:networks:detail', args=[subnet.network_id]) self.assertRedirectsNoFollow(res, redir_url) @@ -696,7 +695,7 @@ class NetworkTests(test.TestCase): 'cidr': subnet.cidr, 'ip_version': subnet.ip_version, 'gateway_ip': gateway_ip} - url = reverse('horizon:nova:networks:editsubnet', + url = reverse('horizon:project:networks:editsubnet', args=[subnet.network_id, subnet.id]) res = self.client.post(url, formData) @@ -722,7 +721,7 @@ class NetworkTests(test.TestCase): self.mox.ReplayAll() formData = {'action': 'subnets__delete__%s' % subnet.id} - url = reverse('horizon:nova:networks:detail', + url = reverse('horizon:project:networks:detail', args=[network_id]) res = self.client.post(url, formData) @@ -749,7 +748,7 @@ class NetworkTests(test.TestCase): self.mox.ReplayAll() formData = {'action': 'subnets__delete__%s' % subnet.id} - url = reverse('horizon:nova:networks:detail', + url = reverse('horizon:project:networks:detail', args=[network_id]) res = self.client.post(url, formData) @@ -763,10 +762,10 @@ class NetworkTests(test.TestCase): self.mox.ReplayAll() - res = self.client.get(reverse('horizon:nova:networks:ports:detail', + res = self.client.get(reverse('horizon:project:networks:ports:detail', args=[port.id])) - self.assertTemplateUsed(res, 'nova/networks/ports/detail.html') + self.assertTemplateUsed(res, 'project/networks/ports/detail.html') self.assertEqual(res.context['port'].id, port.id) @test.create_stubs({api.quantum: ('port_get',)}) @@ -777,7 +776,7 @@ class NetworkTests(test.TestCase): self.mox.ReplayAll() - res = self.client.get(reverse('horizon:nova:networks:ports:detail', + res = self.client.get(reverse('horizon:project:networks:ports:detail', args=[port.id])) self.assertRedirectsNoFollow(res, INDEX_URL) diff --git a/horizon/dashboards/nova/networks/urls.py b/horizon/dashboards/project/networks/urls.py similarity index 100% rename from horizon/dashboards/nova/networks/urls.py rename to horizon/dashboards/project/networks/urls.py diff --git a/horizon/dashboards/nova/networks/views.py b/horizon/dashboards/project/networks/views.py similarity index 93% rename from horizon/dashboards/nova/networks/views.py rename to horizon/dashboards/project/networks/views.py index 73d56a758..32cdef0bd 100644 --- a/horizon/dashboards/nova/networks/views.py +++ b/horizon/dashboards/project/networks/views.py @@ -40,7 +40,7 @@ LOG = logging.getLogger(__name__) class IndexView(tables.DataTableView): table_class = NetworksTable - template_name = 'nova/networks/index.html' + template_name = 'project/networks/index.html' def get_data(self): try: @@ -58,7 +58,7 @@ class IndexView(tables.DataTableView): class CreateView(workflows.WorkflowView): workflow_class = CreateNetwork - template_name = 'nova/networks/create.html' + template_name = 'project/networks/create.html' def get_initial(self): pass @@ -66,9 +66,9 @@ class CreateView(workflows.WorkflowView): class UpdateView(forms.ModalFormView): form_class = UpdateNetwork - template_name = 'nova/networks/update.html' + template_name = 'project/networks/update.html' context_object_name = 'network' - success_url = reverse_lazy("horizon:nova:networks:index") + success_url = reverse_lazy("horizon:project:networks:index") def get_context_data(self, **kwargs): context = super(UpdateView, self).get_context_data(**kwargs) @@ -96,8 +96,8 @@ class UpdateView(forms.ModalFormView): class DetailView(tables.MultiTableView): table_classes = (SubnetsTable, PortsTable) - template_name = 'nova/networks/detail.html' - failure_url = reverse_lazy('horizon:nova:networks:index') + template_name = 'project/networks/detail.html' + failure_url = reverse_lazy('horizon:project:networks:index') def get_subnets_data(self): try: diff --git a/horizon/dashboards/nova/networks/workflows.py b/horizon/dashboards/project/networks/workflows.py similarity index 97% rename from horizon/dashboards/nova/networks/workflows.py rename to horizon/dashboards/project/networks/workflows.py index 82a6f8e23..8fff70dcc 100644 --- a/horizon/dashboards/nova/networks/workflows.py +++ b/horizon/dashboards/project/networks/workflows.py @@ -111,7 +111,7 @@ class CreateNetwork(workflows.Workflow): finalize_button_name = _("Create") success_message = _('Created network "%s".') failure_message = _('Unable to create network "%s".') - success_url = "horizon:nova:networks:index" + success_url = "horizon:project:networks:index" default_steps = (CreateNetworkInfo, CreateSubnetInfo) @@ -131,7 +131,7 @@ class CreateNetwork(workflows.Workflow): except: msg = _('Failed to create network "%s".') % data['net_name'] LOG.info(msg) - redirect = reverse('horizon:nova:networks:index') + redirect = reverse('horizon:project:networks:index') exceptions.handle(request, msg, redirect=redirect) return False @@ -152,7 +152,7 @@ class CreateNetwork(workflows.Workflow): LOG.debug(msg) except Exception: msg = _('Failed to create subnet "%(sub)s" for network "%(net)s".') - redirect = reverse('horizon:nova:networks:index') + redirect = reverse('horizon:project:networks:index') exceptions.handle(request, msg % {"sub": data['cidr'], "net": network.id}, redirect=redirect) diff --git a/horizon/dashboards/syspanel/users/__init__.py b/horizon/dashboards/project/overview/__init__.py similarity index 100% rename from horizon/dashboards/syspanel/users/__init__.py rename to horizon/dashboards/project/overview/__init__.py diff --git a/horizon/dashboards/nova/overview/panel.py b/horizon/dashboards/project/overview/panel.py similarity index 91% rename from horizon/dashboards/nova/overview/panel.py rename to horizon/dashboards/project/overview/panel.py index 6fc75e9bd..c97c78985 100644 --- a/horizon/dashboards/nova/overview/panel.py +++ b/horizon/dashboards/project/overview/panel.py @@ -21,7 +21,7 @@ from django.utils.translation import ugettext_lazy as _ import horizon -from horizon.dashboards.nova import dashboard +from horizon.dashboards.project import dashboard class Overview(horizon.Panel): @@ -29,4 +29,4 @@ class Overview(horizon.Panel): slug = 'overview' -dashboard.Nova.register(Overview) +dashboard.Project.register(Overview) diff --git a/horizon/dashboards/nova/overview/templates/overview/usage.csv b/horizon/dashboards/project/overview/templates/overview/usage.csv similarity index 100% rename from horizon/dashboards/nova/overview/templates/overview/usage.csv rename to horizon/dashboards/project/overview/templates/overview/usage.csv diff --git a/horizon/dashboards/nova/overview/templates/overview/usage.html b/horizon/dashboards/project/overview/templates/overview/usage.html similarity index 100% rename from horizon/dashboards/nova/overview/templates/overview/usage.html rename to horizon/dashboards/project/overview/templates/overview/usage.html diff --git a/horizon/dashboards/nova/overview/tests.py b/horizon/dashboards/project/overview/tests.py similarity index 86% rename from horizon/dashboards/nova/overview/tests.py rename to horizon/dashboards/project/overview/tests.py index 797c1afed..ce054dac1 100644 --- a/horizon/dashboards/nova/overview/tests.py +++ b/horizon/dashboards/project/overview/tests.py @@ -30,7 +30,7 @@ from horizon import test from horizon import usage -INDEX_URL = reverse('horizon:nova:overview:index') +INDEX_URL = reverse('horizon:project:overview:index') class UsageViewTests(test.TestCase): @@ -47,8 +47,8 @@ class UsageViewTests(test.TestCase): api.nova.tenant_quota_usages(IsA(http.HttpRequest)).AndReturn(quotas) self.mox.ReplayAll() - res = self.client.get(reverse('horizon:nova:overview:index')) - self.assertTemplateUsed(res, 'nova/overview/usage.html') + res = self.client.get(reverse('horizon:project:overview:index')) + self.assertTemplateUsed(res, 'project/overview/usage.html') self.assertTrue(isinstance(res.context['usage'], usage.TenantUsage)) self.assertContains(res, 'form-horizontal') @@ -62,7 +62,7 @@ class UsageViewTests(test.TestCase): .AndRaise(exc) self.mox.ReplayAll() - url = reverse('horizon:nova:overview:index') + url = reverse('horizon:project:overview:index') res = self.client.get(url) self.assertRedirects(res, reverse("login") + "?next=" + url) @@ -81,9 +81,9 @@ class UsageViewTests(test.TestCase): api.nova.tenant_quota_usages(IsA(http.HttpRequest)).AndReturn(quotas) self.mox.ReplayAll() - res = self.client.get(reverse('horizon:nova:overview:index') + + res = self.client.get(reverse('horizon:project:overview:index') + "?format=csv") - self.assertTemplateUsed(res, 'nova/overview/usage.csv') + self.assertTemplateUsed(res, 'project/overview/usage.csv') self.assertTrue(isinstance(res.context['usage'], usage.TenantUsage)) def test_usage_exception_usage(self): @@ -100,8 +100,8 @@ class UsageViewTests(test.TestCase): api.nova.tenant_quota_usages(IsA(http.HttpRequest)).AndReturn(quotas) self.mox.ReplayAll() - res = self.client.get(reverse('horizon:nova:overview:index')) - self.assertTemplateUsed(res, 'nova/overview/usage.html') + res = self.client.get(reverse('horizon:project:overview:index')) + self.assertTemplateUsed(res, 'project/overview/usage.html') self.assertEqual(res.context['usage'].usage_list, []) def test_usage_exception_quota(self): @@ -119,8 +119,8 @@ class UsageViewTests(test.TestCase): .AndRaise(self.exceptions.nova) self.mox.ReplayAll() - res = self.client.get(reverse('horizon:nova:overview:index')) - self.assertTemplateUsed(res, 'nova/overview/usage.html') + res = self.client.get(reverse('horizon:project:overview:index')) + self.assertTemplateUsed(res, 'project/overview/usage.html') self.assertEqual(res.context['usage'].quotas, {}) def test_usage_default_tenant(self): @@ -138,6 +138,6 @@ class UsageViewTests(test.TestCase): api.nova.tenant_quota_usages(IsA(http.HttpRequest)).AndReturn(quotas) self.mox.ReplayAll() - res = self.client.get(reverse('horizon:nova:overview:index')) - self.assertTemplateUsed(res, 'nova/overview/usage.html') + res = self.client.get(reverse('horizon:project:overview:index')) + self.assertTemplateUsed(res, 'project/overview/usage.html') self.assertTrue(isinstance(res.context['usage'], usage.TenantUsage)) diff --git a/horizon/dashboards/nova/overview/urls.py b/horizon/dashboards/project/overview/urls.py similarity index 93% rename from horizon/dashboards/nova/overview/urls.py rename to horizon/dashboards/project/overview/urls.py index fc372d5ae..afc0a5130 100644 --- a/horizon/dashboards/nova/overview/urls.py +++ b/horizon/dashboards/project/overview/urls.py @@ -23,7 +23,7 @@ from django.conf.urls.defaults import url, patterns from .views import ProjectOverview, WarningView -urlpatterns = patterns('horizon.dashboards.nova.overview.views', +urlpatterns = patterns('horizon.dashboards.project.overview.views', url(r'^$', ProjectOverview.as_view(), name='index'), url(r'^warning$', WarningView.as_view(), name='warning'), ) diff --git a/horizon/dashboards/nova/overview/views.py b/horizon/dashboards/project/overview/views.py similarity index 92% rename from horizon/dashboards/nova/overview/views.py rename to horizon/dashboards/project/overview/views.py index 7840b75d1..509d209ff 100644 --- a/horizon/dashboards/nova/overview/views.py +++ b/horizon/dashboards/project/overview/views.py @@ -26,7 +26,7 @@ from horizon import usage class ProjectOverview(usage.UsageView): table_class = usage.TenantUsageTable usage_class = usage.TenantUsage - template_name = 'nova/overview/usage.html' + template_name = 'project/overview/usage.html' def get_data(self): super(ProjectOverview, self).get_data() @@ -34,4 +34,4 @@ class ProjectOverview(usage.UsageView): class WarningView(TemplateView): - template_name = "nova/_warning.html" + template_name = "project/_warning.html" diff --git a/horizon/dashboards/syspanel/volumes/__init__.py b/horizon/dashboards/project/volumes/__init__.py similarity index 100% rename from horizon/dashboards/syspanel/volumes/__init__.py rename to horizon/dashboards/project/volumes/__init__.py diff --git a/horizon/dashboards/nova/volumes/forms.py b/horizon/dashboards/project/volumes/forms.py similarity index 97% rename from horizon/dashboards/nova/volumes/forms.py rename to horizon/dashboards/project/volumes/forms.py index fc6db0d65..0796268e3 100644 --- a/horizon/dashboards/nova/volumes/forms.py +++ b/horizon/dashboards/project/volumes/forms.py @@ -4,7 +4,7 @@ # All rights reserved. """ -Views for managing Nova volumes. +Views for managing volumes. """ from django.conf import settings @@ -67,10 +67,10 @@ class CreateForm(forms.SelfHandlingForm): def handle(self, request, data): try: - # FIXME(johnp): Nova (cinderclient) currently returns a useless + # FIXME(johnp): cinderclient currently returns a useless # error message when the quota is exceeded when trying to create # a volume, so we need to check for that scenario here before we - # send it off to Nova to try and create. + # send it off to try and create. usages = api.tenant_quota_usages(request) snapshot_id = None @@ -183,7 +183,7 @@ class AttachForm(forms.SelfHandlingForm): messages.info(request, message) return True except: - redirect = reverse("horizon:nova:volumes:index") + redirect = reverse("horizon:project:volumes:index") exceptions.handle(request, _('Unable to attach volume.'), redirect=redirect) @@ -213,7 +213,7 @@ class CreateSnapshotForm(forms.SelfHandlingForm): messages.info(request, message) return snapshot except: - redirect = reverse("horizon:nova:images_and_snapshots:index") + redirect = reverse("horizon:project:images_and_snapshots:index") exceptions.handle(request, _('Unable to create volume snapshot.'), redirect=redirect) diff --git a/horizon/dashboards/nova/volumes/panel.py b/horizon/dashboards/project/volumes/panel.py similarity index 90% rename from horizon/dashboards/nova/volumes/panel.py rename to horizon/dashboards/project/volumes/panel.py index 1cc890e6d..553980eed 100644 --- a/horizon/dashboards/nova/volumes/panel.py +++ b/horizon/dashboards/project/volumes/panel.py @@ -17,7 +17,7 @@ from django.utils.translation import ugettext_lazy as _ import horizon -from horizon.dashboards.nova import dashboard +from horizon.dashboards.project import dashboard class Volumes(horizon.Panel): @@ -26,4 +26,4 @@ class Volumes(horizon.Panel): permissions = ('openstack.services.volume',) -dashboard.Nova.register(Volumes) +dashboard.Project.register(Volumes) diff --git a/horizon/dashboards/nova/volumes/tables.py b/horizon/dashboards/project/volumes/tables.py similarity index 94% rename from horizon/dashboards/nova/volumes/tables.py rename to horizon/dashboards/project/volumes/tables.py index 8fe9fd1e3..6e01371ed 100644 --- a/horizon/dashboards/nova/volumes/tables.py +++ b/horizon/dashboards/project/volumes/tables.py @@ -56,14 +56,14 @@ class DeleteVolume(tables.DeleteAction): class CreateVolume(tables.LinkAction): name = "create" verbose_name = _("Create Volume") - url = "horizon:nova:volumes:create" + url = "horizon:project:volumes:create" classes = ("ajax-modal", "btn-create") class EditAttachments(tables.LinkAction): name = "attachments" verbose_name = _("Edit Attachments") - url = "horizon:nova:volumes:attach" + url = "horizon:project:volumes:attach" classes = ("ajax-modal", "btn-edit") def allowed(self, request, volume=None): @@ -73,7 +73,7 @@ class EditAttachments(tables.LinkAction): class CreateSnapshot(tables.LinkAction): name = "snapshots" verbose_name = _("Create Snapshot") - url = "horizon:nova:volumes:create_snapshot" + url = "horizon:project:volumes:create_snapshot" classes = ("ajax-modal", "btn-camera") def allowed(self, request, volume=None): @@ -105,7 +105,7 @@ def get_attachment_name(request, attachment): exceptions.handle(request, _("Unable to retrieve " "attachment information.")) try: - url = reverse("horizon:nova:instances:detail", args=(server_id,)) + url = reverse("horizon:project:instances:detail", args=(server_id,)) instance = '%s' % (url, name) except NoReverseMatch: instance = name @@ -141,7 +141,7 @@ class VolumesTableBase(tables.DataTable): ) name = tables.Column("display_name", verbose_name=_("Name"), - link="horizon:nova:volumes:detail") + link="horizon:project:volumes:detail") description = tables.Column("display_description", verbose_name=_("Description"), truncate=40) @@ -161,7 +161,7 @@ class VolumesTableBase(tables.DataTable): class VolumesTable(VolumesTableBase): name = tables.Column("display_name", verbose_name=_("Name"), - link="horizon:nova:volumes:detail") + link="horizon:project:volumes:detail") attachments = AttachmentColumn("attachments", verbose_name=_("Attached To")) @@ -187,7 +187,7 @@ class DetachVolume(tables.BatchAction): api.volume_detach(request, attachment.get('server_id', None), obj_id) def get_success_url(self, request): - return reverse('horizon:nova:volumes:index') + return reverse('horizon:project:volumes:index') class AttachedInstanceColumn(tables.Column): diff --git a/horizon/dashboards/nova/volumes/tabs.py b/horizon/dashboards/project/volumes/tabs.py similarity index 93% rename from horizon/dashboards/nova/volumes/tabs.py rename to horizon/dashboards/project/volumes/tabs.py index eaf533b2d..4c00b1360 100644 --- a/horizon/dashboards/nova/volumes/tabs.py +++ b/horizon/dashboards/project/volumes/tabs.py @@ -25,7 +25,7 @@ from horizon import tabs class OverviewTab(tabs.Tab): name = _("Overview") slug = "overview" - template_name = ("nova/volumes/" + template_name = ("project/volumes/" "_detail_overview.html") def get_context_data(self, request): @@ -36,7 +36,7 @@ class OverviewTab(tabs.Tab): att['instance'] = api.nova.server_get(request, att['server_id']) except: - redirect = reverse('horizon:nova:volumes:index') + redirect = reverse('horizon:project:volumes:index') exceptions.handle(self.request, _('Unable to retrieve volume details.'), redirect=redirect) diff --git a/horizon/dashboards/nova/volumes/templates/volumes/_attach.html b/horizon/dashboards/project/volumes/templates/volumes/_attach.html similarity index 79% rename from horizon/dashboards/nova/volumes/templates/volumes/_attach.html rename to horizon/dashboards/project/volumes/templates/volumes/_attach.html index f9ba15517..7712bb7da 100644 --- a/horizon/dashboards/nova/volumes/templates/volumes/_attach.html +++ b/horizon/dashboards/project/volumes/templates/volumes/_attach.html @@ -2,7 +2,7 @@ {% load i18n %} {% block form_id %}attach_volume_form{% endblock %} -{% block form_action %}{% url horizon:nova:volumes:attach volume.id %}{% endblock %} +{% block form_action %}{% url horizon:project:volumes:attach volume.id %}{% endblock %} {% block form_class %}{{ block.super }} horizontal {% if show_attach %}split_half{% else %} no_split{% endif %}{% endblock %} {% block modal_id %}attach_volume_modal{% endblock %} @@ -21,5 +21,5 @@ {% if show_attach %} {% endif %} - {% trans "Cancel" %} + {% trans "Cancel" %} {% endblock %} diff --git a/horizon/dashboards/nova/volumes/templates/volumes/_create.html b/horizon/dashboards/project/volumes/templates/volumes/_create.html similarity index 89% rename from horizon/dashboards/nova/volumes/templates/volumes/_create.html rename to horizon/dashboards/project/volumes/templates/volumes/_create.html index 8e014cad6..1c5164513 100644 --- a/horizon/dashboards/nova/volumes/templates/volumes/_create.html +++ b/horizon/dashboards/project/volumes/templates/volumes/_create.html @@ -2,7 +2,7 @@ {% load i18n horizon humanize %} {% block form_id %}{% endblock %} -{% block form_action %}{% url horizon:nova:volumes:create %}?{{ request.GET.urlencode }}{% endblock %} +{% block form_action %}{% url horizon:project:volumes:create %}?{{ request.GET.urlencode }}{% endblock %} {% block modal_id %}create_volume_modal{% endblock %} {% block modal-header %}{% trans "Create Volume" %}{% endblock %} @@ -53,5 +53,5 @@ {% block modal-footer %} - {% trans "Cancel" %} + {% trans "Cancel" %} {% endblock %} diff --git a/horizon/dashboards/nova/volumes/templates/volumes/_create_snapshot.html b/horizon/dashboards/project/volumes/templates/volumes/_create_snapshot.html similarity index 76% rename from horizon/dashboards/nova/volumes/templates/volumes/_create_snapshot.html rename to horizon/dashboards/project/volumes/templates/volumes/_create_snapshot.html index 2f28fc103..ab05b5b31 100644 --- a/horizon/dashboards/nova/volumes/templates/volumes/_create_snapshot.html +++ b/horizon/dashboards/project/volumes/templates/volumes/_create_snapshot.html @@ -2,7 +2,7 @@ {% load i18n %} {% block form_id %}{% endblock %} -{% block form_action %}{% url horizon:nova:volumes:create_snapshot volume_id %}{% endblock %} +{% block form_action %}{% url horizon:project:volumes:create_snapshot volume_id %}{% endblock %} {% block modal_id %}create_volume_snapshot_modal{% endblock %} {% block modal-header %}{% trans "Create Volume Snapshot" %}{% endblock %} @@ -21,5 +21,5 @@ {% block modal-footer %} - {% trans "Cancel" %} + {% trans "Cancel" %} {% endblock %} diff --git a/horizon/dashboards/nova/volumes/templates/volumes/_detail_overview.html b/horizon/dashboards/project/volumes/templates/volumes/_detail_overview.html similarity index 93% rename from horizon/dashboards/nova/volumes/templates/volumes/_detail_overview.html rename to horizon/dashboards/project/volumes/templates/volumes/_detail_overview.html index 1844ddcee..145c63a9d 100644 --- a/horizon/dashboards/nova/volumes/templates/volumes/_detail_overview.html +++ b/horizon/dashboards/project/volumes/templates/volumes/_detail_overview.html @@ -37,7 +37,7 @@ {% for attachment in volume.attachments %}
{% trans "Attached To" %}
- {% url horizon:nova:instances:detail attachment.server_id as instance_url%} + {% url horizon:project:instances:detail attachment.server_id as instance_url%} {{ attachment.instance.name }} {% trans "on" %} {{ attachment.device }}
diff --git a/horizon/dashboards/nova/volumes/templates/volumes/attach.html b/horizon/dashboards/project/volumes/templates/volumes/attach.html similarity index 84% rename from horizon/dashboards/nova/volumes/templates/volumes/attach.html rename to horizon/dashboards/project/volumes/templates/volumes/attach.html index b8a5de742..23f6e23b9 100644 --- a/horizon/dashboards/nova/volumes/templates/volumes/attach.html +++ b/horizon/dashboards/project/volumes/templates/volumes/attach.html @@ -7,5 +7,5 @@ {% endblock page_header %} {% block main %} - {% include 'nova/volumes/_attach.html' %} + {% include 'project/volumes/_attach.html' %} {% endblock %} diff --git a/horizon/dashboards/nova/volumes/templates/volumes/create.html b/horizon/dashboards/project/volumes/templates/volumes/create.html similarity index 83% rename from horizon/dashboards/nova/volumes/templates/volumes/create.html rename to horizon/dashboards/project/volumes/templates/volumes/create.html index 8766c83ca..3f4eadef9 100644 --- a/horizon/dashboards/nova/volumes/templates/volumes/create.html +++ b/horizon/dashboards/project/volumes/templates/volumes/create.html @@ -7,5 +7,5 @@ {% endblock page_header %} {% block main %} - {% include 'nova/volumes/_create.html' %} + {% include 'project/volumes/_create.html' %} {% endblock %} diff --git a/horizon/dashboards/nova/volumes/templates/volumes/create_snapshot.html b/horizon/dashboards/project/volumes/templates/volumes/create_snapshot.html similarity index 83% rename from horizon/dashboards/nova/volumes/templates/volumes/create_snapshot.html rename to horizon/dashboards/project/volumes/templates/volumes/create_snapshot.html index 43c568b08..4aa6562eb 100644 --- a/horizon/dashboards/nova/volumes/templates/volumes/create_snapshot.html +++ b/horizon/dashboards/project/volumes/templates/volumes/create_snapshot.html @@ -7,5 +7,5 @@ {% endblock page_header %} {% block main %} - {% include 'nova/volumes/_create_snapshot.html' %} + {% include 'project/volumes/_create_snapshot.html' %} {% endblock %} diff --git a/horizon/dashboards/syspanel/volumes/templates/volumes/detail.html b/horizon/dashboards/project/volumes/templates/volumes/detail.html similarity index 100% rename from horizon/dashboards/syspanel/volumes/templates/volumes/detail.html rename to horizon/dashboards/project/volumes/templates/volumes/detail.html diff --git a/horizon/dashboards/nova/volumes/templates/volumes/index.html b/horizon/dashboards/project/volumes/templates/volumes/index.html similarity index 100% rename from horizon/dashboards/nova/volumes/templates/volumes/index.html rename to horizon/dashboards/project/volumes/templates/volumes/index.html diff --git a/horizon/dashboards/nova/volumes/tests.py b/horizon/dashboards/project/volumes/tests.py similarity index 93% rename from horizon/dashboards/nova/volumes/tests.py rename to horizon/dashboards/project/volumes/tests.py index 31eaf50c7..50bb6fce9 100644 --- a/horizon/dashboards/nova/volumes/tests.py +++ b/horizon/dashboards/project/volumes/tests.py @@ -50,10 +50,10 @@ class VolumeViewTests(test.TestCase): self.mox.ReplayAll() - url = reverse('horizon:nova:volumes:create') + url = reverse('horizon:project:volumes:create') res = self.client.post(url, formData) - redirect_url = reverse('horizon:nova:volumes:index') + redirect_url = reverse('horizon:project:volumes:index') self.assertRedirectsNoFollow(res, redirect_url) @test.create_stubs({api: ('tenant_quota_usages', 'volume_create', @@ -94,19 +94,19 @@ class VolumeViewTests(test.TestCase): self.mox.ReplayAll() # get snapshot from url - url = reverse('horizon:nova:volumes:create') + url = reverse('horizon:project:volumes:create') res = self.client.post("?".join([url, "snapshot_id=" + str(snapshot.id)]), formData) - redirect_url = reverse('horizon:nova:volumes:index') + redirect_url = reverse('horizon:project:volumes:index') self.assertRedirectsNoFollow(res, redirect_url) # get snapshot from dropdown list - url = reverse('horizon:nova:volumes:create') + url = reverse('horizon:project:volumes:create') res = self.client.post(url, formData) - redirect_url = reverse('horizon:nova:volumes:index') + redirect_url = reverse('horizon:project:volumes:index') self.assertRedirectsNoFollow(res, redirect_url) @test.create_stubs({api: ('tenant_quota_usages',), @@ -126,7 +126,7 @@ class VolumeViewTests(test.TestCase): self.mox.ReplayAll() - url = reverse('horizon:nova:volumes:create') + url = reverse('horizon:project:volumes:create') res = self.client.post("?".join([url, "snapshot_id=" + str(snapshot.id)]), formData, follow=True) @@ -150,7 +150,7 @@ class VolumeViewTests(test.TestCase): self.mox.ReplayAll() - url = reverse('horizon:nova:volumes:create') + url = reverse('horizon:project:volumes:create') res = self.client.post(url, formData) expected_error = [u'A volume of 5000GB cannot be created as you only' @@ -173,7 +173,7 @@ class VolumeViewTests(test.TestCase): self.mox.ReplayAll() - url = reverse('horizon:nova:volumes:create') + url = reverse('horizon:project:volumes:create') res = self.client.post(url, formData) expected_error = [u'You are already using all of your available' @@ -198,7 +198,7 @@ class VolumeViewTests(test.TestCase): self.mox.ReplayAll() - url = reverse('horizon:nova:volumes:index') + url = reverse('horizon:project:volumes:index') res = self.client.post(url, formData, follow=True) self.assertMessageCount(res, count=0) @@ -223,7 +223,7 @@ class VolumeViewTests(test.TestCase): self.mox.ReplayAll() - url = reverse('horizon:nova:volumes:index') + url = reverse('horizon:project:volumes:index') res = self.client.post(url, formData, follow=True) self.assertMessageCount(res, error=1) self.assertEqual(list(res.context['messages'])[0].message, @@ -240,7 +240,7 @@ class VolumeViewTests(test.TestCase): api.nova.server_list(IsA(http.HttpRequest)).AndReturn(servers) self.mox.ReplayAll() - url = reverse('horizon:nova:volumes:attach', args=[volume.id]) + url = reverse('horizon:project:volumes:attach', args=[volume.id]) res = self.client.get(url) # Asserting length of 2 accounts for the one instance option, # and the one 'Choose Instance' option. @@ -263,7 +263,7 @@ class VolumeViewTests(test.TestCase): api.nova.server_list(IsA(http.HttpRequest)).AndReturn(servers) self.mox.ReplayAll() - url = reverse('horizon:nova:volumes:attach', args=[volume.id]) + url = reverse('horizon:project:volumes:attach', args=[volume.id]) res = self.client.get(url) # Assert the device field is hidden. form = res.context['form'] @@ -284,7 +284,7 @@ class VolumeViewTests(test.TestCase): self.mox.ReplayAll() - url = reverse('horizon:nova:volumes:attach', + url = reverse('horizon:project:volumes:attach', args=[volume.id]) res = self.client.get(url) @@ -308,7 +308,7 @@ class VolumeViewTests(test.TestCase): self.mox.ReplayAll() - url = reverse('horizon:nova:volumes:detail', + url = reverse('horizon:project:volumes:detail', args=[volume.id]) res = self.client.get(url) @@ -320,7 +320,7 @@ class VolumeViewTests(test.TestCase): self.assertContains(res, "
Available
", 1, 200) self.assertContains(res, "
40 GB
", 1, 200) self.assertContains(res, - ("%s" + ("%s" % server.name), 1, 200) diff --git a/horizon/dashboards/nova/volumes/urls.py b/horizon/dashboards/project/volumes/urls.py similarity index 94% rename from horizon/dashboards/nova/volumes/urls.py rename to horizon/dashboards/project/volumes/urls.py index c9b22af8c..0d6344bf5 100644 --- a/horizon/dashboards/nova/volumes/urls.py +++ b/horizon/dashboards/project/volumes/urls.py @@ -20,7 +20,7 @@ from .views import (IndexView, CreateView, EditAttachmentsView, DetailView, CreateSnapshotView) -urlpatterns = patterns('horizon.dashboards.nova.volumes.views', +urlpatterns = patterns('horizon.dashboards.project.volumes.views', url(r'^$', IndexView.as_view(), name='index'), url(r'^create/$', CreateView.as_view(), name='create'), url(r'^(?P[^/]+)/attach/$', diff --git a/horizon/dashboards/nova/volumes/views.py b/horizon/dashboards/project/volumes/views.py similarity index 92% rename from horizon/dashboards/nova/volumes/views.py rename to horizon/dashboards/project/volumes/views.py index fa788da22..22a6055fc 100644 --- a/horizon/dashboards/nova/volumes/views.py +++ b/horizon/dashboards/project/volumes/views.py @@ -15,7 +15,7 @@ # under the License. """ -Views for managing Nova volumes. +Views for managing volumes. """ import logging @@ -40,7 +40,7 @@ LOG = logging.getLogger(__name__) class IndexView(tables.DataTableView): table_class = VolumesTable - template_name = 'nova/volumes/index.html' + template_name = 'project/volumes/index.html' def _get_volumes(self, search_opts=None): try: @@ -82,13 +82,13 @@ class IndexView(tables.DataTableView): class DetailView(tabs.TabView): tab_group_class = VolumeDetailTabs - template_name = 'nova/volumes/detail.html' + template_name = 'project/volumes/detail.html' class CreateView(forms.ModalFormView): form_class = CreateForm - template_name = 'nova/volumes/create.html' - success_url = reverse_lazy("horizon:nova:volumes:index") + template_name = 'project/volumes/create.html' + success_url = reverse_lazy("horizon:project:volumes:index") def get_context_data(self, **kwargs): context = super(CreateView, self).get_context_data(**kwargs) @@ -101,8 +101,8 @@ class CreateView(forms.ModalFormView): class CreateSnapshotView(forms.ModalFormView): form_class = CreateSnapshotForm - template_name = 'nova/volumes/create_snapshot.html' - success_url = reverse_lazy("horizon:nova:images_and_snapshots:index") + template_name = 'project/volumes/create_snapshot.html' + success_url = reverse_lazy("horizon:project:images_and_snapshots:index") def get_context_data(self, **kwargs): context = super(CreateSnapshotView, self).get_context_data(**kwargs) @@ -116,8 +116,8 @@ class CreateSnapshotView(forms.ModalFormView): class EditAttachmentsView(tables.DataTableView, forms.ModalFormView): table_class = AttachmentsTable form_class = AttachForm - template_name = 'nova/volumes/attach.html' - success_url = reverse_lazy("horizon:nova:volumes:index") + template_name = 'project/volumes/attach.html' + success_url = reverse_lazy("horizon:project:volumes:index") def get_object(self): if not hasattr(self, "_object"): diff --git a/horizon/templates/base.html b/horizon/templates/base.html index 4bda5eabe..32418df64 100644 --- a/horizon/templates/base.html +++ b/horizon/templates/base.html @@ -12,18 +12,6 @@ {% block content %} - {# FIXME(gabriel): remove the following warning block when Nova fixes their scoping upstream. #} - {% if request.user.is_superuser and request.horizon.dashboard.slug == "nova" %} -
-
-

- {% trans "Caution" %}: - {% trans "You are acting as an admin user in the project dashboard." %} -

- {% trans "Learn More" %} -
-
- {% endif %}
{% block sidebar %} {% include 'horizon/common/_sidebar.html' %} diff --git a/horizon/tests/base_tests.py b/horizon/tests/base_tests.py index 011eecded..ecafa42be 100644 --- a/horizon/tests/base_tests.py +++ b/horizon/tests/base_tests.py @@ -29,8 +29,8 @@ from openstack_auth import user, backend import horizon from horizon import base from horizon import test -from horizon.dashboards.nova.dashboard import Nova -from horizon.dashboards.syspanel.dashboard import Syspanel +from horizon.dashboards.project.dashboard import Project +from horizon.dashboards.admin.dashboard import Admin from horizon.dashboards.settings.dashboard import Settings from horizon.tests.test_dashboards.cats.dashboard import Cats from horizon.tests.test_dashboards.cats.kittens.panel import Kittens @@ -83,8 +83,8 @@ class BaseHorizonTests(test.TestCase): panels = base.Horizon._registry[dash]._registry.keys() self._discovered_panels[dash] = panels # Remove the OpenStack dashboards for test isolation. - base.Horizon.unregister(Nova) - base.Horizon.unregister(Syspanel) + base.Horizon.unregister(Project) + base.Horizon.unregister(Admin) base.Horizon.unregister(Settings) def tearDown(self): @@ -97,8 +97,8 @@ class BaseHorizonTests(test.TestCase): del base.Horizon base.Horizon = base.HorizonSite() # Re-register the OpenStack dashboards that we removed. - base.Horizon.register(Nova) - base.Horizon.register(Syspanel) + base.Horizon.register(Project) + base.Horizon.register(Admin) base.Horizon.register(Settings) # Reload the convenience references to Horizon stored in __init__ reload(import_module("horizon")) diff --git a/horizon/tests/testsettings.py b/horizon/tests/testsettings.py index 5b3b29f03..e6075167b 100644 --- a/horizon/tests/testsettings.py +++ b/horizon/tests/testsettings.py @@ -54,8 +54,8 @@ INSTALLED_APPS = ( 'compressor', 'horizon', 'horizon.tests', - 'horizon.dashboards.nova', - 'horizon.dashboards.syspanel', + 'horizon.dashboards.project', + 'horizon.dashboards.admin', 'horizon.dashboards.settings', 'horizon.tests.test_dashboards.cats', 'horizon.tests.test_dashboards.dogs' @@ -111,8 +111,8 @@ SESSION_COOKIE_SECURE = False AUTHENTICATION_BACKENDS = ('openstack_auth.backend.KeystoneBackend',) HORIZON_CONFIG = { - 'dashboards': ('nova', 'syspanel', 'settings'), - 'default_dashboard': 'nova', + 'dashboards': ('project', 'admin', 'settings'), + 'default_dashboard': 'project', "password_validator": { "regex": '^.{8,18}$', "help_text": _("Password must be between 8 and 18 characters.") diff --git a/horizon/views/base.py b/horizon/views/base.py index 2f48d5c2d..2e9e876a2 100644 --- a/horizon/views/base.py +++ b/horizon/views/base.py @@ -31,8 +31,8 @@ def user_home(request): def get_user_home(user): if user.is_superuser: - return horizon.get_dashboard('syspanel').get_absolute_url() - return horizon.get_dashboard('nova').get_absolute_url() + return horizon.get_dashboard('admin').get_absolute_url() + return horizon.get_dashboard('project').get_absolute_url() @vary.vary_on_cookie diff --git a/openstack_dashboard/settings.py b/openstack_dashboard/settings.py index 9d79660bc..5c8354391 100644 --- a/openstack_dashboard/settings.py +++ b/openstack_dashboard/settings.py @@ -51,8 +51,8 @@ ADMIN_MEDIA_PREFIX = '/static/admin/' ROOT_URLCONF = 'openstack_dashboard.urls' HORIZON_CONFIG = { - 'dashboards': ('nova', 'syspanel', 'settings',), - 'default_dashboard': 'nova', + 'dashboards': ('project', 'admin', 'settings',), + 'default_dashboard': 'project', 'user_home': 'horizon.views.base.get_user_home', 'ajax_queue_limit': 10, 'help_url': "http://docs.openstack.org", @@ -121,8 +121,8 @@ INSTALLED_APPS = ( 'django.contrib.humanize', 'compressor', 'horizon', - 'horizon.dashboards.nova', - 'horizon.dashboards.syspanel', + 'horizon.dashboards.project', + 'horizon.dashboards.admin', 'horizon.dashboards.settings', 'openstack_auth', )