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