def get_data(self): try: share_instance_id = self.kwargs['share_instance_id'] share_instance = manila.share_instance_get(self.request, share_instance_id) share_instance.export_locations = ( manila.share_instance_export_location_list( self.request, share_instance_id)) export_locations = [ exp['path'] for exp in share_instance.export_locations ] share_instance.el_size = ui_utils.calculate_longest_str_size( export_locations) return share_instance except Exception: redirect = reverse('horizon:admin:share_instances:index') exceptions.handle(self.request, _('Unable to retrieve share instance details.'), redirect=redirect)
def get_data(self): try: share_instance_id = self.kwargs['share_instance_id'] share_instance = manila.share_instance_get( self.request, share_instance_id) share_instance.export_locations = ( manila.share_instance_export_location_list( self.request, share_instance_id)) export_locations = [ exp['path'] for exp in share_instance.export_locations ] share_instance.el_size = ui_utils.calculate_longest_str_size( export_locations) return share_instance except Exception: redirect = reverse('horizon:admin:share_instances:index') exceptions.handle( self.request, _('Unable to retrieve share instance details.'), redirect=redirect)
def test_share_instance_get(self): api.share_instance_get(self.request, self.id) self.manilaclient.share_instances.get.assert_called_once_with(self.id)