Ejemplo n.º 1
0
 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
Ejemplo n.º 2
0
 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
Ejemplo n.º 3
0
    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)
Ejemplo n.º 4
0
    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)