diff options
Diffstat (limited to 'meta-openstack/recipes-devtools/python/python-glance_git.bb')
| -rw-r--r-- | meta-openstack/recipes-devtools/python/python-glance_git.bb | 40 |
1 files changed, 29 insertions, 11 deletions
diff --git a/meta-openstack/recipes-devtools/python/python-glance_git.bb b/meta-openstack/recipes-devtools/python/python-glance_git.bb index 7775956..fa74aca 100644 --- a/meta-openstack/recipes-devtools/python/python-glance_git.bb +++ b/meta-openstack/recipes-devtools/python/python-glance_git.bb | |||
| @@ -19,7 +19,7 @@ PV="2014.2.b3+git${SRCPV}" | |||
| 19 | 19 | ||
| 20 | S = "${WORKDIR}/git" | 20 | S = "${WORKDIR}/git" |
| 21 | 21 | ||
| 22 | inherit setuptools update-rc.d identity default_configs hosts | 22 | inherit setuptools update-rc.d identity default_configs hosts openstackchef |
| 23 | 23 | ||
| 24 | GLANCE_DEFAULT_STORE ?= "file" | 24 | GLANCE_DEFAULT_STORE ?= "file" |
| 25 | GLANCE_KNOWN_STORES ?= "glance.store.rbd.Store,\ | 25 | GLANCE_KNOWN_STORES ?= "glance.store.rbd.Store,\ |
| @@ -58,18 +58,15 @@ do_install_prepend() { | |||
| 58 | do_install_append() { | 58 | do_install_append() { |
| 59 | TEMPLATE_CONF_DIR=${S}${sysconfdir} | 59 | TEMPLATE_CONF_DIR=${S}${sysconfdir} |
| 60 | GLANCE_CONF_DIR=${D}${sysconfdir}/glance | 60 | GLANCE_CONF_DIR=${D}${sysconfdir}/glance |
| 61 | 61 | ||
| 62 | for file in api registry cache | 62 | for file in api registry cache |
| 63 | do | 63 | do |
| 64 | sed -e "s:%SERVICE_TENANT_NAME%:${SERVICE_TENANT_NAME}:g" \ | 64 | install -m 0600 ${TEMPLATE_CONF_DIR}/glance-$file.conf ${WORKDIR} |
| 65 | ${TEMPLATE_CONF_DIR}/glance-$file.conf > ${WORKDIR}/glance-$file.conf | 65 | sed -e "s!^#connection =.*!connection = postgresql://%DB_USER%:%DB_PASSWORD%@localhost/glance!g" \ |
| 66 | sed -e "s:%SERVICE_USER%:${SRCNAME}:g" -i ${WORKDIR}/glance-$file.conf | 66 | -i ${WORKDIR}/glance-$file.conf |
| 67 | sed -e "s:%SERVICE_PASSWORD%:${SERVICE_PASSWORD}:g" \ | ||
| 68 | -i ${WORKDIR}/glance-$file.conf | ||
| 69 | sed -e "s!^#connection =.*!connection = postgresql://${DB_USER}:${DB_PASSWORD}@localhost/glance!g" \ | ||
| 70 | -i ${WORKDIR}/glance-$file.conf | ||
| 71 | sed -i '/\[keystone_authtoken\]/aidentity_uri=http://127.0.0.1:8081/keystone/admin' ${WORKDIR}/glance-$file.conf | 67 | sed -i '/\[keystone_authtoken\]/aidentity_uri=http://127.0.0.1:8081/keystone/admin' ${WORKDIR}/glance-$file.conf |
| 72 | done | 68 | done |
| 69 | |||
| 73 | sed -e "s:^filesystem_store_datadir =.*:filesystem_store_datadir = ${sysconfdir}/${SRCNAME}/images/:g" \ | 70 | sed -e "s:^filesystem_store_datadir =.*:filesystem_store_datadir = ${sysconfdir}/${SRCNAME}/images/:g" \ |
| 74 | -i ${WORKDIR}/glance-api.conf | 71 | -i ${WORKDIR}/glance-api.conf |
| 75 | 72 | ||
| @@ -79,8 +76,8 @@ do_install_append() { | |||
| 79 | 76 | ||
| 80 | sed 's:^default_store =.*:default_store = ${GLANCE_DEFAULT_STORE}:g' -i ${WORKDIR}/glance-api.conf | 77 | sed 's:^default_store =.*:default_store = ${GLANCE_DEFAULT_STORE}:g' -i ${WORKDIR}/glance-api.conf |
| 81 | sed 's:^swift_store_auth_address =.*:swift_store_auth_address = http\://127.0.0.1\:8081/keystone/main/:g' -i ${WORKDIR}/glance-api.conf | 78 | sed 's:^swift_store_auth_address =.*:swift_store_auth_address = http\://127.0.0.1\:8081/keystone/main/:g' -i ${WORKDIR}/glance-api.conf |
| 82 | sed 's:^swift_store_user =.*:swift_store_user = ${SERVICE_TENANT_NAME}\:${SRCNAME}:g' -i ${WORKDIR}/glance-api.conf | 79 | sed 's:^swift_store_user =.*:swift_store_user = %SERVICE_TENANT_NAME%\:${SRCNAME}:g' -i ${WORKDIR}/glance-api.conf |
| 83 | sed 's:^swift_store_key =.*:swift_store_key = ${SERVICE_PASSWORD}:g' -i ${WORKDIR}/glance-api.conf | 80 | sed 's:^swift_store_key =.*:swift_store_key = %SERVICE_PASSWORD%:g' -i ${WORKDIR}/glance-api.conf |
| 84 | sed 's:^swift_store_create_container_on_put =.*:swift_store_create_container_on_put = True:g' -i ${WORKDIR}/glance-api.conf | 81 | sed 's:^swift_store_create_container_on_put =.*:swift_store_create_container_on_put = True:g' -i ${WORKDIR}/glance-api.conf |
| 85 | 82 | ||
| 86 | # multi line match, replace the known stores with the ones we support. | 83 | # multi line match, replace the known stores with the ones we support. |
| @@ -101,6 +98,21 @@ do_install_append() { | |||
| 101 | 98 | ||
| 102 | install -d ${D}${localstatedir}/log/${SRCNAME} | 99 | install -d ${D}${localstatedir}/log/${SRCNAME} |
| 103 | 100 | ||
| 101 | if [ -z "${OPENSTACKCHEF_ENABLED}" ]; then | ||
| 102 | for file in api registry cache | ||
| 103 | do | ||
| 104 | sed -e "s:%SERVICE_TENANT_NAME%:${SERVICE_TENANT_NAME}:g" \ | ||
| 105 | -i ${GLANCE_CONF_DIR}/glance-$file.conf | ||
| 106 | sed -e "s:%SERVICE_USER%:${SRCNAME}:g" -i ${GLANCE_CONF_DIR}/glance-$file.conf | ||
| 107 | sed -e "s:%SERVICE_PASSWORD%:${SERVICE_PASSWORD}:g" \ | ||
| 108 | -i ${GLANCE_CONF_DIR}/glance-$file.conf | ||
| 109 | sed -e "s:%DB_PASSWORD%:${DB_PASSWORD}:g" \ | ||
| 110 | -i ${GLANCE_CONF_DIR}/glance-$file.conf | ||
| 111 | sed -e "s:%DB_USER%:${DB_USER}:g" \ | ||
| 112 | -i ${GLANCE_CONF_DIR}/glance-$file.conf | ||
| 113 | done | ||
| 114 | fi | ||
| 115 | |||
| 104 | if ${@base_contains('DISTRO_FEATURES', 'sysvinit', 'true', 'false', d)}; then | 116 | if ${@base_contains('DISTRO_FEATURES', 'sysvinit', 'true', 'false', d)}; then |
| 105 | install -d ${D}${sysconfdir}/init.d | 117 | install -d ${D}${sysconfdir}/init.d |
| 106 | sed 's:@suffix@:api:' < ${WORKDIR}/glance.init >${WORKDIR}/glance-api.init.sh | 118 | sed 's:@suffix@:api:' < ${WORKDIR}/glance.init >${WORKDIR}/glance-api.init.sh |
| @@ -112,6 +124,12 @@ do_install_append() { | |||
| 112 | cp run_tests.sh ${GLANCE_CONF_DIR} | 124 | cp run_tests.sh ${GLANCE_CONF_DIR} |
| 113 | } | 125 | } |
| 114 | 126 | ||
| 127 | CHEF_SERVICES_CONF_FILES := "\ | ||
| 128 | ${sysconfdir}/${SRCNAME}/glance-api.conf \ | ||
| 129 | ${sysconfdir}/${SRCNAME}/glance-cache.conf \ | ||
| 130 | ${sysconfdir}/${SRCNAME}/glance-registry.conf \ | ||
| 131 | " | ||
| 132 | |||
| 115 | pkg_postinst_${SRCNAME}-setup () { | 133 | pkg_postinst_${SRCNAME}-setup () { |
| 116 | if [ "x$D" != "x" ]; then | 134 | if [ "x$D" != "x" ]; then |
| 117 | exit 1 | 135 | exit 1 |
