Example #1
0
    def test_tenant_quota_update(self, provided_kwargs, expected_kwargs):
        tenant_id = 'fake_tenant_id'

        api.tenant_quota_update(self.request, tenant_id, **provided_kwargs)

        self.manilaclient.quotas.update.assert_called_once_with(
            tenant_id, **expected_kwargs)
        self.manilaclient.quota_classes.update.assert_not_called()
Example #2
0
    def test_tenant_quota_update(self, provided_kwargs, expected_kwargs):
        tenant_id = 'fake_tenant_id'

        api.tenant_quota_update(self.request, tenant_id, **provided_kwargs)

        self.manilaclient.quotas.update.assert_called_once_with(
            tenant_id, **expected_kwargs)
        self.manilaclient.quota_classes.update.assert_not_called()
Example #3
0
    def handle(self, request, data):
        try:
            super(ManilaCreateProject, self).handle(request, data)

            if base.is_service_enabled(request, 'share'):
                manila_data = dict([(key, data[key])
                                    for key in MANILA_QUOTA_FIELDS])
                manila.tenant_quota_update(request, self.object.id,
                                           **manila_data)

        except Exception:
            horizon.exceptions.handle(request,
                                      _('Unable to set project quotas.'))
        return True
Example #4
0
    def handle(self, request, data):
        try:
            super(ManilaCreateProject, self).handle(request, data)

            if base.is_service_enabled(request, 'share'):
                manila_data = dict([(key, data[key]) for key in
                                    MANILA_QUOTA_FIELDS])
                manila.tenant_quota_update(request,
                                           self.object.id,
                                           **manila_data)

        except Exception:
            horizon.exceptions.handle(request,
                                      _('Unable to set project quotas.'))
        return True
Example #5
0
    def handle(self, request, data):
        try:
            super(ManilaUpdateProject, self).handle(request, data)

            if base.is_service_enabled(request, 'share'):
                manila_data = dict([(key, data[key]) for key in
                                    MANILA_QUOTA_FIELDS])
                manila.tenant_quota_update(request,
                                           data['project_id'],
                                           **manila_data)

        except Exception:
            horizon.exceptions.handle(request,
                                      _('Modified project information and '
                                        'members, but unable to modify '
                                        'project quotas.'))
        return True
Example #6
0
    def handle(self, request, data):
        try:
            super(ManilaUpdateProject, self).handle(request, data)

            if base.is_service_enabled(request, 'share'):
                manila_data = dict([(key, data[key])
                                    for key in MANILA_QUOTA_FIELDS])
                manila.tenant_quota_update(request, data['project_id'],
                                           **manila_data)

        except Exception:
            horizon.exceptions.handle(
                request,
                _('Modified project information and '
                  'members, but unable to modify '
                  'project quotas.'))
        return True
Example #7
0
 def _tenant_quota_update(self, request, project_id, data):
     api_manila.tenant_quota_update(request, project_id, **data)
Example #8
0
 def _tenant_quota_update(self, request, project_id, data):
     api_manila.tenant_quota_update(request, project_id, **data)