diff options
Diffstat (limited to 'meta-openstack/recipes-devtools/python/python-nova-controller_2013.1.3.bb')
| -rw-r--r-- | meta-openstack/recipes-devtools/python/python-nova-controller_2013.1.3.bb | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/meta-openstack/recipes-devtools/python/python-nova-controller_2013.1.3.bb b/meta-openstack/recipes-devtools/python/python-nova-controller_2013.1.3.bb new file mode 100644 index 0000000..686c1d7 --- /dev/null +++ b/meta-openstack/recipes-devtools/python/python-nova-controller_2013.1.3.bb | |||
| @@ -0,0 +1,52 @@ | |||
| 1 | include python-nova.inc | ||
| 2 | |||
| 3 | PR = "r0" | ||
| 4 | |||
| 5 | FILESEXTRAPATHS := "${THISDIR}/${PYTHON_PN}" | ||
| 6 | |||
| 7 | SRC_URI += "file://nova-all \ | ||
| 8 | file://nova.conf \ | ||
| 9 | file://openrc \ | ||
| 10 | " | ||
| 11 | |||
| 12 | inherit controller update-rc.d | ||
| 13 | |||
| 14 | PACKAGES = "${SRCNAME}-controller ${SRCNAME}-controller-misc" | ||
| 15 | |||
| 16 | do_install_append() { | ||
| 17 | if ${@base_contains('DISTRO_FEATURES', 'sysvinit', 'true', 'false', d)}; then | ||
| 18 | install -d ${D}${sysconfdir}/init.d | ||
| 19 | install -m 0755 ${WORKDIR}/nova-all ${D}${sysconfdir}/init.d/nova-all | ||
| 20 | fi | ||
| 21 | } | ||
| 22 | |||
| 23 | pkg_postinst_${SRCNAME}-controller () { | ||
| 24 | if [ "x$D" != "x" ]; then | ||
| 25 | exit 1 | ||
| 26 | fi | ||
| 27 | |||
| 28 | # This is to make sure postgres is configured and running | ||
| 29 | if ! pidof postmaster > /dev/null; then | ||
| 30 | sudo -u postgres initdb -D /etc/postgresql/ | ||
| 31 | /etc/init.d/postgresql start | ||
| 32 | sleep 0.2 | ||
| 33 | sudo -u postgres psql -c "CREATE ROLE ${DB_USER} WITH SUPERUSER LOGIN PASSWORD '${DB_PASSWORD}'" | ||
| 34 | fi | ||
| 35 | |||
| 36 | sudo -u postgres createdb nova | ||
| 37 | nova-manage db sync | ||
| 38 | } | ||
| 39 | |||
| 40 | |||
| 41 | FILES_${SRCNAME}-controller = "${files_${SRCNAME}-controller}" | ||
| 42 | |||
| 43 | # If the compute is built, so we package it out of the way | ||
| 44 | FILES_${SRCNAME}-controller-misc = "${files_${SRCNAME}-compute} ${files_${SRCNAME}-common} ${files_${PYTHON_PN}}" | ||
| 45 | |||
| 46 | RDEPENDS_${SRCNAME}-controller = "${PYTHON_PN} ${SRCNAME}-common \ | ||
| 47 | postgresql postgresql-client python-psycopg2" | ||
| 48 | |||
| 49 | RCONFLICTS_${SRCNAME}-controller = "${SRCNAME}-compute" | ||
| 50 | |||
| 51 | INITSCRIPT_PACKAGES = "${SRCNAME}-controller" | ||
| 52 | INITSCRIPT_NAME_${SRCNAME}-controller = "nova-all" | ||
