def test_service_get(self, mock_log, mock_services_list):
        mock_services_list.return_value = [{'?': {'id': 'foo_service_id'}}]
        result = env_api.service_get(self.mock_request, self.env_id,
                                     'foo_service_id')

        self.assertEqual({'?': {'id': 'foo_service_id'}}, result)
        mock_services_list.assert_called_once_with(
            self.mock_request, 'foo_env_id')
        mock_log.debug.assert_called_with(
            'Return service detail for a specified id')
Exemple #2
0
    def get_data(self):
        service_id = self.kwargs['service_id']
        self.environment_id = env_tables.get_scheduler_id()
        try:
            self.service = api.service_get(self.request, self.environment_id, service_id)
        except exc.HTTPUnauthorized:
            exceptions.handle(self.request)

        except exc.HTTPForbidden:
            redirect = reverse('horizon:murano:scheduler:index')
            exceptions.handle(self.request, _('Unable to retrieve details for task'), redirect=redirect)
        else:
            self._service = self.service
            return self._service
Exemple #3
0
    def get_data(self):
        service_id = self.kwargs["service_id"]
        self.environment_id = self.kwargs["environment_id"]
        try:
            self.service = api.service_get(self.request, self.environment_id, service_id)
        except exc.HTTPUnauthorized:
            exceptions.handle(self.request)

        except exc.HTTPForbidden:
            redirect = reverse("horizon:murano:environments:index")
            exceptions.handle(self.request, _("Unable to retrieve details for " "service"), redirect=redirect)
        else:
            self._service = self.service
            return self._service
Exemple #4
0
    def get_data(self):
        service_id = self.kwargs['service_id']
        self.environment_id = self.kwargs['environment_id']
        try:
            self.service = api.service_get(self.request,
                                           self.environment_id,
                                           service_id)
        except exc.HTTPUnauthorized:
            exceptions.handle(self.request)

        except exc.HTTPForbidden:
            redirect = reverse('horizon:app-catalog:environments:index')
            exceptions.handle(self.request,
                              _('Unable to retrieve details for '
                                'service'),
                              redirect=redirect)
        else:
            self._service = self.service
            return self._service
Exemple #5
0
 def get_data(self, request, service_id):
     environment_id = self.table.kwargs['environment_id']
     return api.service_get(request, environment_id, service_id)
 def get_data(self, request, service_id):
     environment_id = get_cloud_id()
     return api.service_get(request, environment_id, service_id)