based on the equal nova code at
https://review.openstack.org/#/c/41267/ the ratelimiting logic
uses a constant to parse the limits.
Change-Id: I8ffb4267834c79d056716a2c412ecb2c97217635
from cinder import wsgi as base_wsgi
QUOTAS = quota.QUOTAS
+LIMITS_PREFIX = "limits."
# Convenience constants for the limits dictionary passed to Limiter().
# Pick up any per-user limit information
for key, value in kwargs.items():
- if key.startswith('limits.'):
- username = key[7:]
+ if key.startswith(LIMITS_PREFIX):
+ username = key[len(LIMITS_PREFIX):]
self.levels[username] = self.parse_limits(value)
def get_limits(self, username=None):
from cinder import wsgi as base_wsgi
QUOTAS = quota.QUOTAS
+LIMITS_PREFIX = "limits."
# Convenience constants for the limits dictionary passed to Limiter().
# Pick up any per-user limit information
for key, value in kwargs.items():
- if key.startswith('limits.'):
- username = key[7:]
+ if key.startswith(LIMITS_PREFIX):
+ username = key[len(LIMITS_PREFIX):]
self.levels[username] = self.parse_limits(value)
def get_limits(self, username=None):