Esempio n. 1
0
 def get_object(self):
     if not hasattr(self, "_object"):
         sec_service_id = self.kwargs['sec_service_id']
         try:
             self._object = manila.security_service_get(
                 self.request, sec_service_id)
         except Exception:
             msg = _('Unable to retrieve security_service.')
             url = reverse('horizon:project:security_services:index')
             exceptions.handle(self.request, msg, redirect=url)
     return self._object
Esempio n. 2
0
 def get_object(self):
     if not hasattr(self, "_object"):
         sec_service_id = self.kwargs['sec_service_id']
         try:
             self._object = manila.security_service_get(
                 self.request, sec_service_id)
         except Exception:
             msg = _('Unable to retrieve security_service.')
             url = reverse('horizon:project:shares:index')
             exceptions.handle(self.request, msg, redirect=url)
     return self._object
Esempio n. 3
0
 def get_data(self):
     try:
         sec_service_id = self.kwargs['sec_service_id']
         sec_service = manila.security_service_get(
             self.request, sec_service_id)
     except Exception:
         redirect = reverse('horizon:project:shares:index')
         message = _("Unable to retrieve security service "
                     "'%s' details.") % sec_service_id
         exceptions.handle(self.request, message, redirect=redirect)
     return sec_service
Esempio n. 4
0
 def get_data(self):
     try:
         sec_service_id = self.kwargs['sec_service_id']
         sec_service = manila.security_service_get(
             self.request, sec_service_id)
         sec_service.type = utils.get_nice_security_service_type(
             sec_service)
     except Exception:
         message = _("Unable to retrieve security service "
                     "'%s' details.") % sec_service_id
         exceptions.handle(
             self.request, message, redirect=self.redirect_url)
     return sec_service
Esempio n. 5
0
 def get_data(self):
     try:
         sec_service_id = self.kwargs['sec_service_id']
         sec_service = manila.security_service_get(
             self.request, sec_service_id)
         sec_service.type = utils.get_nice_security_service_type(
             sec_service)
     except Exception:
         message = _("Unable to retrieve security service "
                     "'%s' details.") % sec_service_id
         exceptions.handle(
             self.request, message, redirect=self.redirect_url)
     return sec_service
Esempio n. 6
0
    def test_security_service_get(self):
        sec_service_id = 'fake_sec_service_id'
        api.security_service_get(self.request, sec_service_id)

        self.manilaclient.security_services.get.assert_called_once_with(
            sec_service_id)