summaryrefslogtreecommitdiffstats
path: root/meta-openstack/recipes-devtools/python/python-swift_git.bb
diff options
context:
space:
mode:
authorMark Asselstine <mark.asselstine@windriver.com>2017-11-15 12:59:53 -0500
committerBruce Ashfield <bruce.ashfield@windriver.com>2017-11-15 15:53:38 -0500
commit3051160f23fe8e06e545859538c86ef3a3c39d7a (patch)
tree97f922e30173df31dda04f10cca3beea27652eb8 /meta-openstack/recipes-devtools/python/python-swift_git.bb
parent3d512115129e2cea97067d23cb72fea62b70dd39 (diff)
downloadmeta-cloud-services-3051160f23fe8e06e545859538c86ef3a3c39d7a.tar.gz
python-*: fixup postinst scripts
Checking for "$D" and doing an "exit 1" now results in errors such as: [log_check] warning: %post(keystone-cronjobs-...) scriptlet failed, exit status 2 during image creation. Instead of escaping the script for "level-1" (image creation postinst) we wrap the "level-2" (first boot) postinst in an if statement. This also ensure the scriptlet in indentity.bbclass is less prone to behaving differently based on the postinsts defined in the classes which inherit 'identity'. Signed-off-by: Mark Asselstine <mark.asselstine@windriver.com> Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
Diffstat (limited to 'meta-openstack/recipes-devtools/python/python-swift_git.bb')
-rw-r--r--meta-openstack/recipes-devtools/python/python-swift_git.bb40
1 files changed, 19 insertions, 21 deletions
diff --git a/meta-openstack/recipes-devtools/python/python-swift_git.bb b/meta-openstack/recipes-devtools/python/python-swift_git.bb
index 8552ea7..fc7c258 100644
--- a/meta-openstack/recipes-devtools/python/python-swift_git.bb
+++ b/meta-openstack/recipes-devtools/python/python-swift_git.bb
@@ -109,28 +109,26 @@ do_install_append() {
109} 109}
110 110
111pkg_postinst_${SRCNAME}-setup () { 111pkg_postinst_${SRCNAME}-setup () {
112 if [ "x$D" != "x" ]; then 112 if [ -z "x$D" ]; then
113 exit 1 113 CLUSTER_CONF=/etc/swift/cluster.conf
114 SWIFT_SETUP='/bin/bash /etc/swift/swift_setup.sh'
115
116 for i in `seq 1 3`; do
117 BACKING_FILE=/etc/swift/swift_backing_$i
118 if [ "x${SWIFT_BACKING_FILE_SIZE}" != "x0G" ]; then
119 truncate -s ${SWIFT_BACKING_FILE_SIZE} $BACKING_FILE
120 sed "s:%SWIFT_BACKING_FILE_${i}%:$BACKING_FILE:g" -i $CLUSTER_CONF
121 else
122 sed "s:%SWIFT_BACKING_FILE_${i}%::g" -i $CLUSTER_CONF
123 fi
124 done
125
126 $SWIFT_SETUP createrings
127 $SWIFT_SETUP formatdevs
128 $SWIFT_SETUP mountdevs
129 $SWIFT_SETUP -i "${CONTROLLER_IP}" adddevs
130 $SWIFT_SETUP unmountdevs
114 fi 131 fi
115
116 CLUSTER_CONF=/etc/swift/cluster.conf
117 SWIFT_SETUP='/bin/bash /etc/swift/swift_setup.sh'
118
119 for i in `seq 1 3`; do
120 BACKING_FILE=/etc/swift/swift_backing_$i
121 if [ "x${SWIFT_BACKING_FILE_SIZE}" != "x0G" ]; then
122 truncate -s ${SWIFT_BACKING_FILE_SIZE} $BACKING_FILE
123 sed "s:%SWIFT_BACKING_FILE_${i}%:$BACKING_FILE:g" -i $CLUSTER_CONF
124 else
125 sed "s:%SWIFT_BACKING_FILE_${i}%::g" -i $CLUSTER_CONF
126 fi
127 done
128
129 $SWIFT_SETUP createrings
130 $SWIFT_SETUP formatdevs
131 $SWIFT_SETUP mountdevs
132 $SWIFT_SETUP -i "${CONTROLLER_IP}" adddevs
133 $SWIFT_SETUP unmountdevs
134} 132}
135 133
136PACKAGES += "${SRCNAME}-tests ${SRCNAME} ${SRCNAME}-setup" 134PACKAGES += "${SRCNAME}-tests ${SRCNAME} ${SRCNAME}-setup"