diff --git a/horizon/horizon/dashboards/nova/instances_and_volumes/volumes/tables.py b/horizon/horizon/dashboards/nova/instances_and_volumes/volumes/tables.py index f6c703f7855..21c57b7412d 100644 --- a/horizon/horizon/dashboards/nova/instances_and_volumes/volumes/tables.py +++ b/horizon/horizon/dashboards/nova/instances_and_volumes/volumes/tables.py @@ -134,7 +134,6 @@ def get_object_display(self, obj): def get_object_by_id(self, obj_id): for obj in self.data: - print self.get_object_id(obj) if self.get_object_id(obj) == obj_id: return obj raise ValueError('No match found for the id "%s".' % obj_id) diff --git a/horizon/horizon/dashboards/nova/instances_and_volumes/volumes/views.py b/horizon/horizon/dashboards/nova/instances_and_volumes/volumes/views.py index d1f1e8ebc17..984d7a0937b 100644 --- a/horizon/horizon/dashboards/nova/instances_and_volumes/volumes/views.py +++ b/horizon/horizon/dashboards/nova/instances_and_volumes/volumes/views.py @@ -68,19 +68,20 @@ class EditAttachmentsView(tables.DataTableView): template_name = 'nova/instances_and_volumes/volumes/attach.html' def get_object(self): - if not hasattr(self, "object"): + if not hasattr(self, "_object"): volume_id = self.kwargs['volume_id'] try: - self.object = api.volume_get(self.request, volume_id) + self._object = api.volume_get(self.request, volume_id) except: - self.object = None + self._object = None exceptions.handle(self.request, _('Unable to retrieve volume information.')) - return self.object + return self._object def get_data(self): try: - attachments = [att for att in self.object.attachments if att] + volumes = self.get_object() + attachments = [att for att in volumes.attachments if att] except: attachments = [] exceptions.handle(self.request, @@ -102,7 +103,7 @@ def get(self, request, *args, **kwargs): "index") context = self.get_context_data(**kwargs) context['form'] = form - context['volume'] = self.object + context['volume'] = self.get_object() return self.render_to_response(context) def post(self, request, *args, **kwargs):