Merge "Updates quota values to be read from conf file"

This commit is contained in:
Jenkins
2015-09-18 20:01:27 +00:00
committed by Gerrit Code Review
2 changed files with 27 additions and 25 deletions

View File

@@ -129,6 +129,27 @@ ks_queue_opts = [
'notification server processing functionality.')),
]
quota_opt_group = cfg.OptGroup(name='quotas',
title='Quota Options')
quota_opts = [
cfg.IntOpt('quota_secrets',
default=-1,
help='Number of secrets allowed per project'),
cfg.IntOpt('quota_orders',
default=-1,
help='Number of orders allowed per project'),
cfg.IntOpt('quota_containers',
default=-1,
help='Number of containers allowed per project'),
cfg.IntOpt('quota_consumers',
default=-1,
help='Number of consumers allowed per project'),
cfg.IntOpt('quota_cas',
default=-1,
help='Number of CAs allowed per project')
]
def parse_args(conf, args=None, usage=None, default_config_files=None):
conf(args=args if args else [],
@@ -162,6 +183,10 @@ def new_config():
conf.register_group(ks_queue_opt_group)
conf.register_opts(ks_queue_opts, group=ks_queue_opt_group)
conf.register_group(quota_opt_group)
conf.register_opts(quota_opts, group=quota_opt_group)
return conf

View File

@@ -13,9 +13,9 @@
# See the License for the specific language governing permissions and
# limitations under the License.
from oslo_config import cfg
from oslo_log import log as logging
from barbican.common import config
from barbican.common import exception
from barbican.common import hrefs
from barbican.common import resources as res
@@ -27,30 +27,7 @@ LOG = logging.getLogger(__name__)
UNLIMITED_VALUE = -1
DISABLED_VALUE = 0
quota_opt_group = cfg.OptGroup(name='quotas',
title='Quota Options')
quota_opts = [
cfg.IntOpt('quota_secrets',
default=-1,
help='Number of secrets allowed per project'),
cfg.IntOpt('quota_orders',
default=-1,
help='Number of orders allowed per project'),
cfg.IntOpt('quota_containers',
default=-1,
help='Number of containers allowed per project'),
cfg.IntOpt('quota_consumers',
default=-1,
help='Number of consumers allowed per project'),
cfg.IntOpt('quota_cas',
default=-1,
help='Number of CAs allowed per project')]
CONF = cfg.CONF
CONF.register_group(quota_opt_group)
CONF.register_opts(quota_opts, group=quota_opt_group)
CONF = config.CONF
class QuotaDriver(object):