Commit Graph

11 Commits

Author SHA1 Message Date
TommyLike 5b5715e2ad [policy in code] Add support for service, limits
This patch adds policy in code support for capabilities,
hosts, services, limits and depends on the quota patch [1].

[1]: https://review.openstack.org/#/c/508091/

Change-Id: Ib2bac2d28d950c0d8b734a54e300dd4185d98ca9
Partial-Implements: blueprint policy-in-code
2017-10-12 15:08:34 +08:00
Sean McGinnis e918482674 Use constants for microversion values
We very often end up with merge conflicts for any patches that increment
microversions due to conflicting numbers. We can't really solve that,
but we can avoid the need to update version numbers throughout the code
by defining a constant value in one place and using that variable instead.

Change-Id: Ib3a80fee6caaabb49af097aa197f550c65d94985
2017-09-22 08:15:56 -05:00
wangxiyuan 4a2448bd15 Add project_id admin filter to limits API
"cinder absolute-limits" command supports <tenant_id> filter,
But server side doesn't, this patch added the support for server
side.

APIImpact

Closes-bug: #1668416
Change-Id: Ib31ab87d0954c2bedf55c6d71623b2c7d07b5fa7
2017-06-18 18:15:35 +08:00
Ivan Kolodyazhny c042a05ac3 Remove XML API
Cinder XML API is not tested by Tempest about for one year.
We don't know if it works or not. It was deprecated in
Mitaka release.

Implements blueprint: remove-xml-api
APIImpact
DocImpact
UpgradeImpact

Change-Id: If98db25f1f4032725444c3959acb9aad8f869802
2016-04-21 16:05:29 +00:00
Gaozexu 4bdeb045e4 Fix UsedLimitsController's authorizer to soft
The rule "limits_extension:used_limits" is used by
"UsedLimitsController" which is a controller extension and it extends
"limits" api. Most of controller extensions authorize user's context
by applying the function "extensions.soft_extension_authorizer()",
but "UsedLimitsController" applies "extensions.extension_authorizer"
and this may cause 403 Forbidden error.

In this patch, I changed UsedLimitsController's authorizer to
"soft_extension_authorizer".

APIImpact

Co-Authored-By: ZhuChunzhan <zhucz@cn.fujitsu.com>

Change-Id: I8a4163ca89236b35c2c6ba10bcd98f8c42ef9089
Closes-Bug: #1497868
2015-10-28 14:53:55 +08:00
Victor Stinner 55eca11e07 Replace dict.iteritems() with dict.items()
This change adds Python 3 compatibility to the modified code.

Replace also six.iteritems(obj) with obj.items().

The iteritems() method of Python 2 dictionaries was renamed to items()
on Python 3. As discussed on the openstack-dev mailing list, iteritems()
must be replaced with items(), six.iteritems() should not be used. In
OpenStack, the overhead of creating a temporary list with dict.items()
on Python 2 is negligible.

Blueprint cinder-python3
Change-Id: Ic3d8fd6b71d2c9f21929b0d6bf68c8f84a5e2567
2015-06-12 15:18:57 +02:00
ling-yun baa34a301b Support Volume Backup Quota
Since quota take volumes, snapshots and gigabytes into account, it also
needs to take backup into account.
1. Backup create API is not admin interface, users of projects could
create any number of backups.
2. If some evil users create many more big backups to exhaust the free
space of backup storage-backend, it would cause cinder-backup in the state
of rejecting service.
Based on these two points, I think it is necessary to support volume
backup quota.

blueprint support-volume-backup-quota

Change-Id: Idd24ad2e8a5507bf18e90bd5fad59a4af1c158c6
2014-09-02 18:09:04 +08:00
Zhiteng Huang 3accff25db Enable F402 checks and fix violations
This change enables F402 hacking check and fixes all violations found.

[F402] import module from line N shadowed by loop variable

Basically this rule tries to avoid loop variables using the same name as
imported module, for example:

    from cinder import volume
    ...

    for volume in volumes:
        ...

Change-Id: Ie3010616ca87fda113d452fe684e6cff3d5fd978
2014-08-13 22:01:05 +05:30
liyingjun c9c6befe7e Add snapshot related data to limits api
When calling the limits api we can only get Volume and Gigabyte data,
the snapshot related limit value should be returned too.

Change-Id: I6a5e1e2d1aa6abbac5d5dacd042223ce49207c1f
Closes-bug: 1282924
2014-02-24 16:07:19 +08:00
DennyZhang ff3f2e5735 Remove vim header
No need to set tabstop tons of times, this can be set in your vimrc
file instead.

More disucssion:
http://openstack.10931.n7.nabble.com/Remove-vim-modelines-td21780.html

Partial-Bug: #1229324
Change-Id: Ib3a31c8819ee1950d72f7da5627593623d351560
2013-12-30 18:53:02 -06:00
Olivier Pilotte 8aa8ebc0a0 Cinder extension to add used resources in absolute limits
* totalVolumesUsed
* totalGigabytesUsed

DocImpact
Implements: blueprint cinder-used-resources-in-absolute-limits
Change-Id: I525a61043ce2f906c424738ab361ee7396f072b5
2013-10-16 09:51:19 -04:00