Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from django.utils.translation import ugettext_lazy as _
- from horizon import exceptions
- from horizon import tabs
- from horizon_bsn import api
- from horizon_bsn.content.reachabilitytest.tables import ReachabilityTestsTable
- from openstack_dashboard.api.neutron import NeutronAPIDictWrapper
- class ReachabilityTestsTab(tabs.TableTab):
- table_classes = (ReachabilityTestsTable,)
- name = _("Reachability Tests")
- slug = "reachabilitytest_tab"
- template_name = "horizon/common/_detail_table.html"
- # def has_more_data(self, table):
- # return self._has_more
- def get_reachabilitytests_data(self):
- print("request is:")
- print(str(self.request))
- try:
- print("getting the marker")
- marker = self.request.GET.get(\
- ReachabilityTestsTable._meta.pagination_param, None)
- print("getting the reachability tests")
- reachabilitytests = api.neutron.reachabilitytest_list(self.request)
- print("results we got are:")
- print(reachabilitytests)
- #return reachabilitytests
- return [NeutronAPIDictWrapper({"id": "0ffb9bfa-ae27-4f78-9ea9-064176c1d1df", "name": "test1", "src_tenant_id": "tenant1", "src_segment_id": "segment1", "src_ip": "10.1.1.1", "dst_ip": "10.2.1.1", "expected_result": "dropped"})]
- except Exception:
- self._has_more = False
- error_message = _('Unable to get Reachability Tests')
- """try:
- marker = self.request.GET.get(
- ReachabilityTestsTable._meta.pagination_param, None)
- reachabilitytests, self._has_more = api.neutron.reachabilitytest_list(
- self.request,
- search_opts=({'marker': marker, 'paginate': True}))
- return reachabilitytests
- except Exception:
- self._has_more = False
- error_message = _('Unable to get Reachability Tests')"""
- class ReachabilityTestTabs(tabs.TabGroup):
- slug = "reachabilitypanel_tabs"
- tabs = (ReachabilityTestsTab,)
- sticky = True
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement