diff options
| author | Mihai Prica <prica.mihai@gmail.com> | 2013-07-15 15:43:58 +0300 |
|---|---|---|
| committer | Bruce Ashfield <bruce.ashfield@windriver.com> | 2013-08-28 18:41:58 -0400 |
| commit | a09d5bdcc421460b9dc9e1a052feadaeef4aff49 (patch) | |
| tree | b090a3d78fffb742e618bca0335c345ccc45d7ba /meta-openstack/recipes-devtools/python/python-glance_2013.1.bb | |
| parent | 01ecebcecdfa79889dee478eedea1ab48a9e3ca6 (diff) | |
| download | meta-cloud-services-a09d5bdcc421460b9dc9e1a052feadaeef4aff49.tar.gz | |
python-glance: Load credentials from the identity class
The configuration files are now automatically created from
the templates.
Signed-off-by: Mihai Prica <prica.mihai@gmail.com>
Diffstat (limited to 'meta-openstack/recipes-devtools/python/python-glance_2013.1.bb')
| -rw-r--r-- | meta-openstack/recipes-devtools/python/python-glance_2013.1.bb | 26 |
1 files changed, 17 insertions, 9 deletions
diff --git a/meta-openstack/recipes-devtools/python/python-glance_2013.1.bb b/meta-openstack/recipes-devtools/python/python-glance_2013.1.bb index 90d1813..d8cd97b 100644 --- a/meta-openstack/recipes-devtools/python/python-glance_2013.1.bb +++ b/meta-openstack/recipes-devtools/python/python-glance_2013.1.bb | |||
| @@ -8,9 +8,6 @@ PR = "r0" | |||
| 8 | SRCNAME = "glance" | 8 | SRCNAME = "glance" |
| 9 | 9 | ||
| 10 | SRC_URI = "https://launchpad.net/glance/grizzly/${PV}/+download/${SRCNAME}-${PV}.tar.gz \ | 10 | SRC_URI = "https://launchpad.net/glance/grizzly/${PV}/+download/${SRCNAME}-${PV}.tar.gz \ |
| 11 | file://glance-api.conf \ | ||
| 12 | file://glance-cache.conf \ | ||
| 13 | file://glance-registry.conf \ | ||
| 14 | file://glance.init \ | 11 | file://glance.init \ |
| 15 | " | 12 | " |
| 16 | 13 | ||
| @@ -19,14 +16,26 @@ SRC_URI[sha256sum] = "f4deee125ee6729daee5315c6aacd9e265c3015692a62ae6aefeadbd3f | |||
| 19 | 16 | ||
| 20 | S = "${WORKDIR}/${SRCNAME}-${PV}" | 17 | S = "${WORKDIR}/${SRCNAME}-${PV}" |
| 21 | 18 | ||
| 22 | inherit setuptools update-rc.d | 19 | inherit setuptools update-rc.d identity |
| 23 | 20 | ||
| 24 | do_install_append() { | 21 | do_install_append() { |
| 25 | 22 | TEMPLATE_CONF_DIR=${S}${sysconfdir} | |
| 26 | GLANCE_CONF_DIR=${D}${sysconfdir}/glance | 23 | GLANCE_CONF_DIR=${D}${sysconfdir}/glance |
| 27 | 24 | ||
| 28 | install -d ${GLANCE_CONF_DIR} | 25 | for file in api registry cache |
| 26 | do | ||
| 27 | sed -e "s:%SERVICE_TENANT_NAME%:${SERVICE_TENANT_NAME}:g" \ | ||
| 28 | ${TEMPLATE_CONF_DIR}/glance-$file.conf > ${WORKDIR}/glance-$file.conf | ||
| 29 | sed -e "s:%SERVICE_USER%:${SRCNAME}:g" -i ${WORKDIR}/glance-$file.conf | ||
| 30 | sed -e "s:%SERVICE_PASSWORD%:${SERVICE_PASSWORD}:g" \ | ||
| 31 | -i ${WORKDIR}/glance-$file.conf | ||
| 32 | sed -e "s#^sql_conn.*#sql_connection = postgresql://admin:admin@localhost/glance#g" \ | ||
| 33 | -i ${WORKDIR}/glance-$file.conf | ||
| 34 | done | ||
| 35 | sed -e "s:^filesystem_store_datadir =.*:filesystem_store_datadir = ${sysconfdir}/${SRCNAME}/images/:g" \ | ||
| 36 | -i ${WORKDIR}/glance-api.conf | ||
| 29 | 37 | ||
| 38 | install -d ${GLANCE_CONF_DIR} | ||
| 30 | install -m 600 ${WORKDIR}/glance-registry.conf ${GLANCE_CONF_DIR}/ | 39 | install -m 600 ${WORKDIR}/glance-registry.conf ${GLANCE_CONF_DIR}/ |
| 31 | install -m 600 ${WORKDIR}/glance-api.conf ${GLANCE_CONF_DIR}/ | 40 | install -m 600 ${WORKDIR}/glance-api.conf ${GLANCE_CONF_DIR}/ |
| 32 | install -m 600 ${WORKDIR}/glance-cache.conf ${GLANCE_CONF_DIR}/ | 41 | install -m 600 ${WORKDIR}/glance-cache.conf ${GLANCE_CONF_DIR}/ |
| @@ -61,9 +70,8 @@ pkg_postinst_${SRCNAME} () { | |||
| 61 | sleep 0.2 | 70 | sleep 0.2 |
| 62 | sudo -u postgres psql -c "CREATE ROLE admin WITH SUPERUSER LOGIN PASSWORD 'admin'" | 71 | sudo -u postgres psql -c "CREATE ROLE admin WITH SUPERUSER LOGIN PASSWORD 'admin'" |
| 63 | fi | 72 | fi |
| 64 | 73 | ||
| 65 | # Needed when using a MySQL backend | 74 | mkdir /var/log/glance |
| 66 | # mysql -u root -e "CREATE DATABASE glance CHARACTER SET utf8;" | ||
| 67 | sudo -u postgres createdb glance | 75 | sudo -u postgres createdb glance |
| 68 | glance-manage db_sync | 76 | glance-manage db_sync |
| 69 | } | 77 | } |
