diff options
Diffstat (limited to 'meta-openstack/recipes-devtools/python/python-cinder_git.bb')
| -rw-r--r-- | meta-openstack/recipes-devtools/python/python-cinder_git.bb | 45 |
1 files changed, 26 insertions, 19 deletions
diff --git a/meta-openstack/recipes-devtools/python/python-cinder_git.bb b/meta-openstack/recipes-devtools/python/python-cinder_git.bb index c648bae..4e0be66 100644 --- a/meta-openstack/recipes-devtools/python/python-cinder_git.bb +++ b/meta-openstack/recipes-devtools/python/python-cinder_git.bb | |||
| @@ -32,6 +32,12 @@ do_install_prepend() { | |||
| 32 | sed 's:%PYTHON_SITEPACKAGES_DIR%:${PYTHON_SITEPACKAGES_DIR}:g' -i ${S}/${SRCNAME}/tests/conf_fixture.py | 32 | sed 's:%PYTHON_SITEPACKAGES_DIR%:${PYTHON_SITEPACKAGES_DIR}:g' -i ${S}/${SRCNAME}/tests/conf_fixture.py |
| 33 | } | 33 | } |
| 34 | 34 | ||
| 35 | CINDER_LVM_VOLUME_BACKING_FILE_SIZE ?= "2G" | ||
| 36 | CINDER_NFS_VOLUME_SERVERS_DEFAULT = "controller:/etc/cinder/nfs_volumes" | ||
| 37 | CINDER_NFS_VOLUME_SERVERS ?= "${CINDER_NFS_VOLUME_SERVERS_DEFAULT}" | ||
| 38 | CINDER_GLUSTERFS_VOLUME_SERVERS_DEFAULT = "controller:/glusterfs_volumes" | ||
| 39 | CINDER_GLUSTERFS_VOLUME_SERVERS ?= "${CINDER_GLUSTERFS_VOLUME_SERVERS_DEFAULT}" | ||
| 40 | |||
| 35 | do_install_append() { | 41 | do_install_append() { |
| 36 | TEMPLATE_CONF_DIR=${S}${sysconfdir}/${SRCNAME} | 42 | TEMPLATE_CONF_DIR=${S}${sysconfdir}/${SRCNAME} |
| 37 | CINDER_CONF_DIR=${D}${sysconfdir}/${SRCNAME} | 43 | CINDER_CONF_DIR=${D}${sysconfdir}/${SRCNAME} |
| @@ -76,13 +82,24 @@ do_install_append() { | |||
| 76 | # test setup | 82 | # test setup |
| 77 | cp run_tests.sh ${CINDER_CONF_DIR} | 83 | cp run_tests.sh ${CINDER_CONF_DIR} |
| 78 | cp -r tools ${CINDER_CONF_DIR} | 84 | cp -r tools ${CINDER_CONF_DIR} |
| 79 | } | ||
| 80 | 85 | ||
| 81 | CINDER_LVM_VOLUME_BACKING_FILE_SIZE ?= "2G" | 86 | #Create cinder volume group backing file |
| 82 | CINDER_NFS_VOLUME_SERVERS_DEFAULT = "controller:/etc/cinder/nfs_volumes" | 87 | sed 's/%CINDER_LVM_VOLUME_BACKING_FILE_SIZE%/${CINDER_LVM_VOLUME_BACKING_FILE_SIZE}/g' -i ${D}/etc/cinder/drivers/lvm_iscsi_setup.sh |
| 83 | CINDER_NFS_VOLUME_SERVERS ?= "${CINDER_NFS_VOLUME_SERVERS_DEFAULT}" | 88 | mkdir -p ${D}/etc/tgt/ |
| 84 | CINDER_GLUSTERFS_VOLUME_SERVERS_DEFAULT = "controller:/glusterfs_volumes" | 89 | echo "include /etc/cinder/data/volumes/*" > ${D}/etc/tgt/targets.conf |
| 85 | CINDER_GLUSTERFS_VOLUME_SERVERS ?= "${CINDER_GLUSTERFS_VOLUME_SERVERS_DEFAULT}" | 90 | |
| 91 | # Create Cinder nfs_share config file with default nfs server | ||
| 92 | echo "${CINDER_NFS_VOLUME_SERVERS}" > ${D}/etc/cinder/nfs_shares | ||
| 93 | sed 's/\s\+/\n/g' -i ${D}/etc/cinder/nfs_shares | ||
| 94 | [ "x${CINDER_NFS_VOLUME_SERVERS}" = "x${CINDER_NFS_VOLUME_SERVERS_DEFAULT}" ] && is_default="1" || is_default="0" | ||
| 95 | sed -e "s:%IS_DEFAULT%:${is_default}:g" -i ${D}/etc/cinder/drivers/nfs_setup.sh | ||
| 96 | |||
| 97 | # Create Cinder glusterfs_share config file with default glusterfs server | ||
| 98 | echo "${CINDER_GLUSTERFS_VOLUME_SERVERS}" > ${D}/etc/cinder/glusterfs_shares | ||
| 99 | sed 's/\s\+/\n/g' -i ${D}/etc/cinder/glusterfs_shares | ||
| 100 | [ "x${CINDER_GLUSTERFS_VOLUME_SERVERS}" = "x${CINDER_GLUSTERFS_VOLUME_SERVERS_DEFAULT}" ] && is_default="1" || is_default="0" | ||
| 101 | sed -e "s:%IS_DEFAULT%:${is_default}:g" -i ${D}/etc/cinder/drivers/glusterfs_setup.sh | ||
| 102 | } | ||
| 86 | 103 | ||
| 87 | pkg_postinst_${SRCNAME}-setup () { | 104 | pkg_postinst_${SRCNAME}-setup () { |
| 88 | if [ "x$D" != "x" ]; then | 105 | if [ "x$D" != "x" ]; then |
| @@ -102,31 +119,21 @@ pkg_postinst_${SRCNAME}-setup () { | |||
| 102 | sudo -u postgres createdb cinder | 119 | sudo -u postgres createdb cinder |
| 103 | cinder-manage db sync | 120 | cinder-manage db sync |
| 104 | 121 | ||
| 105 | #Create cinder volume group backing file | ||
| 106 | sed 's/%CINDER_LVM_VOLUME_BACKING_FILE_SIZE%/${CINDER_LVM_VOLUME_BACKING_FILE_SIZE}/g' -i /etc/cinder/drivers/lvm_iscsi_setup.sh | ||
| 107 | echo "include /etc/cinder/data/volumes/*" >> /etc/tgt/targets.conf | ||
| 108 | |||
| 109 | # Create Cinder nfs_share config file with default nfs server | 122 | # Create Cinder nfs_share config file with default nfs server |
| 110 | if [ ! -f /etc/cinder/nfs_shares ]; then | 123 | if [ ! -f /etc/cinder/nfs_shares ]; then |
| 111 | echo "${CINDER_NFS_VOLUME_SERVERS}" > /etc/cinder/nfs_shares | 124 | /bin/bash /etc/cinder/drivers/nfs_setup.sh |
| 112 | sed 's/\s\+/\n/g' -i /etc/cinder/nfs_shares | ||
| 113 | [[ "x${CINDER_NFS_VOLUME_SERVERS}" == "x${CINDER_NFS_VOLUME_SERVERS_DEFAULT}" ]] && is_default="1" || is_default="0" | ||
| 114 | /bin/bash /etc/cinder/drivers/nfs_setup.sh ${is_default} | ||
| 115 | fi | 125 | fi |
| 116 | 126 | ||
| 117 | # Create Cinder glusterfs_share config file with default glusterfs server | 127 | # Create Cinder glusterfs_share config file with default glusterfs server |
| 118 | if [ ! -f /etc/cinder/glusterfs_shares ] && [ -f /usr/sbin/glusterfsd ]; then | 128 | if [ ! -f /etc/cinder/glusterfs_shares ] && [ -f /usr/sbin/glusterfsd ]; then |
| 119 | echo "${CINDER_GLUSTERFS_VOLUME_SERVERS}" > /etc/cinder/glusterfs_shares | 129 | /bin/bash /etc/cinder/drivers/glusterfs_setup.sh |
| 120 | sed 's/\s\+/\n/g' -i /etc/cinder/glusterfs_shares | ||
| 121 | [[ "x${CINDER_GLUSTERFS_VOLUME_SERVERS}" == "x${CINDER_GLUSTERFS_VOLUME_SERVERS_DEFAULT}" ]] && is_default="1" || is_default="0" | ||
| 122 | /bin/bash /etc/cinder/drivers/glusterfs_setup.sh ${is_default} | ||
| 123 | fi | 130 | fi |
| 124 | } | 131 | } |
| 125 | 132 | ||
| 126 | PACKAGES += "${SRCNAME}-tests ${SRCNAME} ${SRCNAME}-setup ${SRCNAME}-api ${SRCNAME}-volume ${SRCNAME}-scheduler ${SRCNAME}-backup" | 133 | PACKAGES += "${SRCNAME}-tests ${SRCNAME} ${SRCNAME}-setup ${SRCNAME}-api ${SRCNAME}-volume ${SRCNAME}-scheduler ${SRCNAME}-backup" |
| 127 | ALLOW_EMPTY_${SRCNAME}-setup = "1" | 134 | ALLOW_EMPTY_${SRCNAME}-setup = "1" |
| 128 | 135 | ||
| 129 | FILES_${PN} = "${libdir}/*" | 136 | FILES_${PN} = "${libdir}/* /etc/tgt" |
| 130 | 137 | ||
| 131 | FILES_${SRCNAME}-tests = "${sysconfdir}/${SRCNAME}/run_tests.sh \ | 138 | FILES_${SRCNAME}-tests = "${sysconfdir}/${SRCNAME}/run_tests.sh \ |
| 132 | ${sysconfdir}/${SRCNAME}/tools" | 139 | ${sysconfdir}/${SRCNAME}/tools" |
