diff options
| -rw-r--r-- | meta-openstack/recipes-devtools/python/python-glance/0001-glance-store-only-load-known-stores-not-all-stores.patch | 30 | ||||
| -rw-r--r-- | meta-openstack/recipes-devtools/python/python-glance_git.bb | 21 |
2 files changed, 46 insertions, 5 deletions
diff --git a/meta-openstack/recipes-devtools/python/python-glance/0001-glance-store-only-load-known-stores-not-all-stores.patch b/meta-openstack/recipes-devtools/python/python-glance/0001-glance-store-only-load-known-stores-not-all-stores.patch new file mode 100644 index 0000000..080f6ed --- /dev/null +++ b/meta-openstack/recipes-devtools/python/python-glance/0001-glance-store-only-load-known-stores-not-all-stores.patch | |||
| @@ -0,0 +1,30 @@ | |||
| 1 | From 929b981a5970082980dcda7ad531ab7f2fb71577 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Bruce Ashfield <bruce.ashfield@windriver.com> | ||
| 3 | Date: Wed, 30 Apr 2014 23:54:30 -0400 | ||
| 4 | Subject: [PATCH] glance/store: only load known stores, not all stores | ||
| 5 | |||
| 6 | To avoid the import of modules and support for unnecessary storage options, | ||
| 7 | we only load the store modules that are specified as known_stores in the | ||
| 8 | glance-api.conf. | ||
| 9 | |||
| 10 | Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com> | ||
| 11 | --- | ||
| 12 | glance/store/__init__.py | 2 +- | ||
| 13 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
| 14 | |||
| 15 | diff --git a/glance/store/__init__.py b/glance/store/__init__.py | ||
| 16 | index 33a67d626d37..0fdedcfe3c86 100644 | ||
| 17 | --- a/glance/store/__init__.py | ||
| 18 | +++ b/glance/store/__init__.py | ||
| 19 | @@ -181,7 +181,7 @@ def create_stores(): | ||
| 20 | """ | ||
| 21 | store_count = 0 | ||
| 22 | store_classes = set() | ||
| 23 | - for store_entry in set(CONF.known_stores + _ALL_STORES): | ||
| 24 | + for store_entry in set(CONF.known_stores): | ||
| 25 | store_entry = store_entry.strip() | ||
| 26 | if not store_entry: | ||
| 27 | continue | ||
| 28 | -- | ||
| 29 | 1.7.10.4 | ||
| 30 | |||
diff --git a/meta-openstack/recipes-devtools/python/python-glance_git.bb b/meta-openstack/recipes-devtools/python/python-glance_git.bb index d2f5f21..54aaca2 100644 --- a/meta-openstack/recipes-devtools/python/python-glance_git.bb +++ b/meta-openstack/recipes-devtools/python/python-glance_git.bb | |||
| @@ -7,18 +7,25 @@ LIC_FILES_CHKSUM = "file://LICENSE;md5=1dece7821bf3fd70fe1309eaa37d52a2" | |||
| 7 | PR = "r0" | 7 | PR = "r0" |
| 8 | SRCNAME = "glance" | 8 | SRCNAME = "glance" |
| 9 | 9 | ||
| 10 | SRC_URI = "git://github.com/openstack/${SRCNAME}.git;branch=stable/havana \ | 10 | SRC_URI = "git://github.com/openstack/${SRCNAME}.git;branch=stable/icehouse \ |
| 11 | file://0001-glance-store-only-load-known-stores-not-all-stores.patch \ | ||
| 11 | file://glance.init \ | 12 | file://glance.init \ |
| 12 | " | 13 | " |
| 13 | 14 | ||
| 14 | SRCREV="1690a739cd94efe6cb2af8e794a4acdf59de54cd" | 15 | SRCREV="556eebb7780b55af87c0fe49b76593f833ea189a" |
| 15 | PV="2013.2.2+git${SRCPV}" | 16 | PV="2014.1+git${SRCPV}" |
| 16 | 17 | ||
| 17 | S = "${WORKDIR}/git" | 18 | S = "${WORKDIR}/git" |
| 18 | 19 | ||
| 19 | inherit setuptools update-rc.d identity default_configs | 20 | inherit setuptools update-rc.d identity default_configs |
| 20 | 21 | ||
| 21 | GLANCE_DEFAULT_STORE ?= "file" | 22 | GLANCE_DEFAULT_STORE ?= "file" |
| 23 | GLANCE_KNOWN_STORES ?= "glance.store.rbd.Store,\ | ||
| 24 | glance.store.swift.Store,\ | ||
| 25 | glance.store.cinder.Store,\ | ||
| 26 | glance.store.filesystem.Store,\ | ||
| 27 | glance.store.http.Store" | ||
| 28 | |||
| 22 | 29 | ||
| 23 | do_install_append() { | 30 | do_install_append() { |
| 24 | TEMPLATE_CONF_DIR=${S}${sysconfdir} | 31 | TEMPLATE_CONF_DIR=${S}${sysconfdir} |
| @@ -31,14 +38,14 @@ do_install_append() { | |||
| 31 | sed -e "s:%SERVICE_USER%:${SRCNAME}:g" -i ${WORKDIR}/glance-$file.conf | 38 | sed -e "s:%SERVICE_USER%:${SRCNAME}:g" -i ${WORKDIR}/glance-$file.conf |
| 32 | sed -e "s:%SERVICE_PASSWORD%:${SERVICE_PASSWORD}:g" \ | 39 | sed -e "s:%SERVICE_PASSWORD%:${SERVICE_PASSWORD}:g" \ |
| 33 | -i ${WORKDIR}/glance-$file.conf | 40 | -i ${WORKDIR}/glance-$file.conf |
| 34 | sed -e "s#^sql_conn.*#sql_connection = postgresql://${DB_USER}:${DB_PASSWORD}@localhost/glance#g" \ | 41 | sed -e "s!^#connection =.*!connection = postgresql://${DB_USER}:${DB_PASSWORD}@localhost/glance!g" \ |
| 35 | -i ${WORKDIR}/glance-$file.conf | 42 | -i ${WORKDIR}/glance-$file.conf |
| 36 | done | 43 | done |
| 37 | sed -e "s:^filesystem_store_datadir =.*:filesystem_store_datadir = ${sysconfdir}/${SRCNAME}/images/:g" \ | 44 | sed -e "s:^filesystem_store_datadir =.*:filesystem_store_datadir = ${sysconfdir}/${SRCNAME}/images/:g" \ |
| 38 | -i ${WORKDIR}/glance-api.conf | 45 | -i ${WORKDIR}/glance-api.conf |
| 39 | 46 | ||
| 40 | # send samples to rabbitmq for ceilometer integration | 47 | # send samples to rabbitmq for ceilometer integration |
| 41 | sed -e "s:^notifier_strategy = noop:notifier_strategy = rabbit:g" \ | 48 | sed -e "s:^# notification_driver = noop:notification_driver = rabbit:g" \ |
| 42 | -i ${WORKDIR}/glance-api.conf | 49 | -i ${WORKDIR}/glance-api.conf |
| 43 | 50 | ||
| 44 | sed 's:^default_store =.*:default_store = ${GLANCE_DEFAULT_STORE}:g' -i ${WORKDIR}/glance-api.conf | 51 | sed 's:^default_store =.*:default_store = ${GLANCE_DEFAULT_STORE}:g' -i ${WORKDIR}/glance-api.conf |
| @@ -47,6 +54,9 @@ do_install_append() { | |||
| 47 | sed 's:^swift_store_key =.*:swift_store_key = ${SERVICE_PASSWORD}:g' -i ${WORKDIR}/glance-api.conf | 54 | sed 's:^swift_store_key =.*:swift_store_key = ${SERVICE_PASSWORD}:g' -i ${WORKDIR}/glance-api.conf |
| 48 | sed 's:^swift_store_create_container_on_put =.*:swift_store_create_container_on_put = True:g' -i ${WORKDIR}/glance-api.conf | 55 | sed 's:^swift_store_create_container_on_put =.*:swift_store_create_container_on_put = True:g' -i ${WORKDIR}/glance-api.conf |
| 49 | 56 | ||
| 57 | # multi line match, replace the known stores with the ones we support. | ||
| 58 | sed '1!N; s:#known_stores = glance.store.*\n.*#.*glance.store.http.*:known_stores = ${GLANCE_KNOWN_STORES}:g' -i ${WORKDIR}/glance-api.conf | ||
| 59 | |||
| 50 | install -d ${GLANCE_CONF_DIR} | 60 | install -d ${GLANCE_CONF_DIR} |
| 51 | install -m 600 ${WORKDIR}/glance-registry.conf ${GLANCE_CONF_DIR}/ | 61 | install -m 600 ${WORKDIR}/glance-registry.conf ${GLANCE_CONF_DIR}/ |
| 52 | install -m 600 ${WORKDIR}/glance-api.conf ${GLANCE_CONF_DIR}/ | 62 | install -m 600 ${WORKDIR}/glance-api.conf ${GLANCE_CONF_DIR}/ |
| @@ -55,6 +65,7 @@ do_install_append() { | |||
| 55 | install -m 600 ${S}/etc/glance-registry-paste.ini ${GLANCE_CONF_DIR}/ | 65 | install -m 600 ${S}/etc/glance-registry-paste.ini ${GLANCE_CONF_DIR}/ |
| 56 | install -m 600 ${S}/etc/glance-api-paste.ini ${GLANCE_CONF_DIR}/ | 66 | install -m 600 ${S}/etc/glance-api-paste.ini ${GLANCE_CONF_DIR}/ |
| 57 | install -m 600 ${S}/etc/policy.json ${GLANCE_CONF_DIR}/ | 67 | install -m 600 ${S}/etc/policy.json ${GLANCE_CONF_DIR}/ |
| 68 | install -m 600 ${S}/etc/schema-image.json ${GLANCE_CONF_DIR}/ | ||
| 58 | 69 | ||
| 59 | install -d ${GLANCE_CONF_DIR}/images | 70 | install -d ${GLANCE_CONF_DIR}/images |
| 60 | install -d ${D}${localstatedir}/lib/glance/image_cache | 71 | install -d ${D}${localstatedir}/lib/glance/image_cache |
