From 7b1c8e1d5d37ce4a88ca90ff949fe86ff0d45315 Mon Sep 17 00:00:00 2001 From: Bruce Ashfield Date: Wed, 7 May 2014 00:14:10 -0400 Subject: glance: update to stable/icehouse Updating glance to the icehouse release. Changes include: - patch glance to not load ALL backend modules, only the ones defined in the glance configuration. Without this patch, we must have support for all backends, even if we don't use them. To avoid including support for unused backends .. we prefer to only load used ones. - Add a variable GLANCE_KNOWN_STORES to the recipe, which will be copied into the glance configuration to enable the loading of supported options (as modifed by the first patch). - Change "sql_connection" to the new "connection" directive - Change the "notifier_strategy" to the new "notification_driver" Signed-off-by: Bruce Ashfield --- ...ore-only-load-known-stores-not-all-stores.patch | 30 ++++++++++++++++++++++ .../recipes-devtools/python/python-glance_git.bb | 21 +++++++++++---- 2 files changed, 46 insertions(+), 5 deletions(-) create mode 100644 meta-openstack/recipes-devtools/python/python-glance/0001-glance-store-only-load-known-stores-not-all-stores.patch (limited to 'meta-openstack/recipes-devtools/python') 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 @@ +From 929b981a5970082980dcda7ad531ab7f2fb71577 Mon Sep 17 00:00:00 2001 +From: Bruce Ashfield +Date: Wed, 30 Apr 2014 23:54:30 -0400 +Subject: [PATCH] glance/store: only load known stores, not all stores + +To avoid the import of modules and support for unnecessary storage options, +we only load the store modules that are specified as known_stores in the +glance-api.conf. + +Signed-off-by: Bruce Ashfield +--- + glance/store/__init__.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/glance/store/__init__.py b/glance/store/__init__.py +index 33a67d626d37..0fdedcfe3c86 100644 +--- a/glance/store/__init__.py ++++ b/glance/store/__init__.py +@@ -181,7 +181,7 @@ def create_stores(): + """ + store_count = 0 + store_classes = set() +- for store_entry in set(CONF.known_stores + _ALL_STORES): ++ for store_entry in set(CONF.known_stores): + store_entry = store_entry.strip() + if not store_entry: + continue +-- +1.7.10.4 + 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" PR = "r0" SRCNAME = "glance" -SRC_URI = "git://github.com/openstack/${SRCNAME}.git;branch=stable/havana \ +SRC_URI = "git://github.com/openstack/${SRCNAME}.git;branch=stable/icehouse \ + file://0001-glance-store-only-load-known-stores-not-all-stores.patch \ file://glance.init \ " -SRCREV="1690a739cd94efe6cb2af8e794a4acdf59de54cd" -PV="2013.2.2+git${SRCPV}" +SRCREV="556eebb7780b55af87c0fe49b76593f833ea189a" +PV="2014.1+git${SRCPV}" S = "${WORKDIR}/git" inherit setuptools update-rc.d identity default_configs GLANCE_DEFAULT_STORE ?= "file" +GLANCE_KNOWN_STORES ?= "glance.store.rbd.Store,\ + glance.store.swift.Store,\ + glance.store.cinder.Store,\ + glance.store.filesystem.Store,\ + glance.store.http.Store" + do_install_append() { TEMPLATE_CONF_DIR=${S}${sysconfdir} @@ -31,14 +38,14 @@ do_install_append() { sed -e "s:%SERVICE_USER%:${SRCNAME}:g" -i ${WORKDIR}/glance-$file.conf sed -e "s:%SERVICE_PASSWORD%:${SERVICE_PASSWORD}:g" \ -i ${WORKDIR}/glance-$file.conf - sed -e "s#^sql_conn.*#sql_connection = postgresql://${DB_USER}:${DB_PASSWORD}@localhost/glance#g" \ + sed -e "s!^#connection =.*!connection = postgresql://${DB_USER}:${DB_PASSWORD}@localhost/glance!g" \ -i ${WORKDIR}/glance-$file.conf done sed -e "s:^filesystem_store_datadir =.*:filesystem_store_datadir = ${sysconfdir}/${SRCNAME}/images/:g" \ -i ${WORKDIR}/glance-api.conf # send samples to rabbitmq for ceilometer integration - sed -e "s:^notifier_strategy = noop:notifier_strategy = rabbit:g" \ + sed -e "s:^# notification_driver = noop:notification_driver = rabbit:g" \ -i ${WORKDIR}/glance-api.conf sed 's:^default_store =.*:default_store = ${GLANCE_DEFAULT_STORE}:g' -i ${WORKDIR}/glance-api.conf @@ -47,6 +54,9 @@ do_install_append() { sed 's:^swift_store_key =.*:swift_store_key = ${SERVICE_PASSWORD}:g' -i ${WORKDIR}/glance-api.conf sed 's:^swift_store_create_container_on_put =.*:swift_store_create_container_on_put = True:g' -i ${WORKDIR}/glance-api.conf + # multi line match, replace the known stores with the ones we support. + sed '1!N; s:#known_stores = glance.store.*\n.*#.*glance.store.http.*:known_stores = ${GLANCE_KNOWN_STORES}:g' -i ${WORKDIR}/glance-api.conf + install -d ${GLANCE_CONF_DIR} install -m 600 ${WORKDIR}/glance-registry.conf ${GLANCE_CONF_DIR}/ install -m 600 ${WORKDIR}/glance-api.conf ${GLANCE_CONF_DIR}/ @@ -55,6 +65,7 @@ do_install_append() { install -m 600 ${S}/etc/glance-registry-paste.ini ${GLANCE_CONF_DIR}/ install -m 600 ${S}/etc/glance-api-paste.ini ${GLANCE_CONF_DIR}/ install -m 600 ${S}/etc/policy.json ${GLANCE_CONF_DIR}/ + install -m 600 ${S}/etc/schema-image.json ${GLANCE_CONF_DIR}/ install -d ${GLANCE_CONF_DIR}/images install -d ${D}${localstatedir}/lib/glance/image_cache -- cgit v1.2.3-54-g00ecf