Esempio n. 1
0
 def create_class(cls, context, class_name, resource, limit):
     try:
         db.quota_class_get(context, class_name, resource)
     except exception.QuotaClassNotFound:
         cls._create_class_in_db(context, class_name, resource, limit)
     else:
         raise exception.QuotaClassExists(class_name=class_name,
                                          resource=resource)
Esempio n. 2
0
 def create_class(cls, context, class_name, resource, limit):
     try:
         db.quota_class_get(context, class_name, resource)
     except exception.QuotaClassNotFound:
         cls._create_class_in_db(context, class_name, resource, limit)
     else:
         raise exception.QuotaClassExists(class_name=class_name,
                                          resource=resource)
Esempio n. 3
0
    def get_by_class(self, context, quota_class, resource):
        """Get a specific quota by quota class."""

        return db.quota_class_get(context, quota_class, resource)
Esempio n. 4
0
 def get_class(cls, context, class_name, resource):
     try:
         qclass = cls._get_class_from_db(context, class_name, resource)
     except exception.QuotaClassNotFound:
         qclass = db.quota_class_get(context, class_name, resource)
     return qclass
Esempio n. 5
0
    def get_by_class(self, context, quota_class, resource):
        """Get a specific quota by quota class."""

        return db.quota_class_get(context, quota_class, resource)
Esempio n. 6
0
 def get_class(cls, context, class_name, resource):
     try:
         qclass = cls._get_class_from_db(context, class_name, resource)
     except exception.QuotaClassNotFound:
         qclass = db.quota_class_get(context, class_name, resource)
     return qclass