def get_data(self): try: share_id = self.kwargs['share_id'] share = manila.share_get(self.request, share_id) share.rules = manila.share_rules_list(self.request, share_id) share.export_locations = manila.share_export_location_list( self.request, share_id) share.el_size = self._calculate_size_of_longest_export_location( share.export_locations) except Exception: redirect = reverse('horizon:project:shares:index') exceptions.handle(self.request, _('Unable to retrieve share details.'), redirect=redirect) return share
def get_data(self): try: share_id = self.kwargs['share_id'] share = manila.share_get(self.request, share_id) share.rules = manila.share_rules_list(self.request, share_id) share.export_locations = manila.share_export_location_list( self.request, share_id) share.el_size = self._calculate_size_of_longest_export_location( share.export_locations) except Exception: redirect = reverse('horizon:project:shares:index') exceptions.handle(self.request, _('Unable to retrieve share details.'), redirect=redirect) return share
def test_list_share_export_locations(self): api.share_export_location_list(self.request, self.id) self.manilaclient.share_export_locations.list.assert_called_once_with( self.id)
def test_list_share_export_locations(self): api.share_export_location_list(self.request, self.id) self.manilaclient.share_export_locations.list.assert_called_once_with( self.id)