コード例 #1
0
 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)
コード例 #2
0
ファイル: views.py プロジェクト: openstack/manila-ui
 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)
コード例 #3
0
    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)
コード例 #4
0
ファイル: test_manila.py プロジェクト: vponomaryov/manila-ui
    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)