Beispiel #1
0
    def test_security_service_update(self, kwargs):
        sec_service_id = "fake_sec_service_id"

        api.security_service_update(self.request, sec_service_id, **kwargs)

        mock_sec_service_update = self.manilaclient.security_services.update
        mock_sec_service_update.assert_called_once_with(
            sec_service_id, **kwargs)
Beispiel #2
0
    def handle(self, request, data):
        sec_service_id = self.initial['sec_service_id']
        try:
            manila.security_service_update(request, sec_service_id,
                                           name=data['name'],
                                           description=data['description'])

            message = _('Successfully updated security service '
                        '"%s"') % data['name']
            messages.success(request, message)
            return True
        except Exception:
            redirect = reverse("horizon:project:security_services:index")
            exceptions.handle(request,
                              _('Unable to update security service.'),
                              redirect=redirect)
Beispiel #3
0
    def handle(self, request, data):
        sec_service_id = self.initial['sec_service_id']
        try:
            manila.security_service_update(request, sec_service_id,
                                           name=data['name'],
                                           description=data['description'])

            message = _('Successfully updated security service '
                        '"%s"') % data['name']
            messages.success(request, message)
            return True
        except Exception:
            redirect = reverse("horizon:project:shares:index")
            exceptions.handle(request,
                              _('Unable to update security service.'),
                              redirect=redirect)
Beispiel #4
0
    def test_security_service_update(self, kwargs):
        sec_service_id = "fake_sec_service_id"

        expected_kwargs = {
            "dns_ip": None,
            "server": None,
            "domain": None,
            "user": None,
            "password": None,
            "name": None,
            "description": None
        }
        expected_kwargs.update(**kwargs)

        api.security_service_update(self.request, sec_service_id, **kwargs)

        mock_sec_service_update = self.manilaclient.security_services.update
        mock_sec_service_update.assert_called_once_with(
            sec_service_id, **expected_kwargs)
Beispiel #5
0
    def handle(self, request, data):
        sec_service_id = self.initial['sec_service_id']
        try:
            manila.security_service_update(
                request, sec_service_id,
                dns_ip=data['dns_ip'],
                ou=data['ou'],
                server=data['server'],
                domain=data['domain'],
                password=data.get('password') or None,
                user=data['user'],
                name=data['name'],
                description=data['description'])

            message = _('Successfully updated security service '
                        '"%s"') % data['name']
            messages.success(request, message)
            return True
        except Exception:
            redirect = reverse("horizon:project:security_services:index")
            exceptions.handle(request,
                              _('Unable to update security service.'),
                              redirect=redirect)