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

« back to all changes in this revision

Viewing changes to hooks/nova_compute_utils.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:
74
74
    CEPH_CONF,
75
75
    ceph_config_file,
76
76
    HostIPContext,
 
77
    APIRateLimitingContext
77
78
)
78
79
 
79
80
CA_CERT_PATH = '/usr/local/share/ca-certificates/keystone_juju_ca_cert.crt'
150
151
LIBVIRT_BIN = '/etc/default/libvirt-bin'
151
152
LIBVIRT_BIN_OVERRIDES = '/etc/init/libvirt-bin.override'
152
153
NOVA_CONF = '%s/nova.conf' % NOVA_CONF_DIR
 
154
API_PASTE_INI = '%s/api-paste.ini' % NOVA_CONF_DIR
153
155
 
154
156
BASE_RESOURCE_MAP = {
155
157
    NOVA_CONF: {
175
177
                     HostIPContext(),
176
178
                     context.LogLevelContext()],
177
179
    },
 
180
    API_PASTE_INI: {
 
181
        'services': ['nova-compute'],
 
182
        'contexts': [APIRateLimitingContext()]}
178
183
}
179
184
 
180
185
LIBVIRT_RESOURCE_MAP = {