summaryrefslogtreecommitdiff
path: root/openstack_dashboard/dashboards
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2017-01-30 12:59:55 +0000
committerGerrit Code Review <review@openstack.org>2017-01-30 12:59:55 +0000
commit1f1c8c62055144b10aa677d097f7839285b88db3 (patch)
treee1b1fa1ed6171c9ad852aa8b16fad61f801ce7dd /openstack_dashboard/dashboards
parent3821e62351625cbf4c7a09dc790989385bce208e (diff)
parent73f867514864954cca49e957e15011ab8b6e90aa (diff)
downloadhorizon-1f1c8c62055144b10aa677d097f7839285b88db3.tar.gz
Merge "Support to delete instance from network topology view"
Diffstat (limited to 'openstack_dashboard/dashboards')
-rw-r--r--openstack_dashboard/dashboards/project/network_topology/views.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/openstack_dashboard/dashboards/project/network_topology/views.py b/openstack_dashboard/dashboards/project/network_topology/views.py
index b7c3955c4..4bc3b4d83 100644
--- a/openstack_dashboard/dashboards/project/network_topology/views.py
+++ b/openstack_dashboard/dashboards/project/network_topology/views.py
@@ -159,6 +159,19 @@ class InstanceView(i_views.IndexView):
table_class = instances_tables.InstancesTable
template_name = 'project/network_topology/iframe.html'
+ def get_data(self):
+ self._more = False
+ # Get instance by id, return a list of one instance
+ # If failed to retrieve the instance, return an empty list
+ try:
+ instance_id = self.request.GET.get("id", "")
+ instance = api.nova.server_get(self.request, instance_id)
+ return [instance]
+ except Exception:
+ exceptions.handle(self.request,
+ _('Unable to retrieve the instance.'))
+ return []
+
class RouterView(r_views.IndexView):
table_class = routers_tables.RoutersTable