~gnuoy/charms/trusty/nova-compute/no-hugepages

« back to all changes in this revision

Viewing changes to hooks/nova_compute_context.py

[tribaal, r=gnuoy] This branch introduces a new api-rate-limit-rules charm config option controlling the rate-limiting 
of the nova API by writing the passed value to the /etc/nova/api-paste.ini file.

Show diffs side-by-side

added added

removed removed

Lines of Context:
496
496
            ctxt['host_ip'] = host_ip
497
497
 
498
498
        return ctxt
 
499
 
 
500
 
 
501
class APIRateLimitingContext(context.OSContextGenerator):
 
502
    def __call__(self):
 
503
        ctxt = {}
 
504
        rate_rules = config('api-rate-limit-rules')
 
505
        if rate_rules:
 
506
            ctxt['api_rate_limit_rules'] = rate_rules
 
507
        return ctxt