summaryrefslogtreecommitdiffstats
path: root/meta-openstack/recipes-devtools/python/python-nova_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-nova_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-nova_git.bb')
-rw-r--r--meta-openstack/recipes-devtools/python/python-nova_git.bb42
1 files changed, 19 insertions, 23 deletions
diff --git a/meta-openstack/recipes-devtools/python/python-nova_git.bb b/meta-openstack/recipes-devtools/python/python-nova_git.bb
index f3a6b86..7b560a7 100644
--- a/meta-openstack/recipes-devtools/python/python-nova_git.bb
+++ b/meta-openstack/recipes-devtools/python/python-nova_git.bb
@@ -160,33 +160,29 @@ do_install_append() {
160} 160}
161 161
162pkg_postinst_${SRCNAME}-setup () { 162pkg_postinst_${SRCNAME}-setup () {
163 if [ "x$D" != "x" ]; then 163 if [ -z "$D" ]; then
164 exit 1 164 # This is to make sure postgres is configured and running
165 if ! pidof postmaster > /dev/null; then
166 /etc/init.d/postgresql-init
167 /etc/init.d/postgresql start
168 sleep 5
169 fi
170
171 sudo -u postgres createdb nova
172 sleep 2
173 nova-manage db sync
165 fi 174 fi
166
167 # This is to make sure postgres is configured and running
168 if ! pidof postmaster > /dev/null; then
169 /etc/init.d/postgresql-init
170 /etc/init.d/postgresql start
171 sleep 5
172 fi
173
174 sudo -u postgres createdb nova
175 sleep 2
176 nova-manage db sync
177} 175}
178 176
179pkg_postinst_${SRCNAME}-common () { 177pkg_postinst_${SRCNAME}-common () {
180 if [ "x$D" != "x" ]; then 178 if [ -z "$D" ]; then
181 exit 1 179 if [ -d /home/root ]; then
182 fi 180 echo "source /etc/nova/openrc" >> /home/root/.bashrc
183 181 echo "source /etc/nova/openrc" >> /home/root/.profile
184 if [ -d /home/root ]; then 182 else
185 echo "source /etc/nova/openrc" >> /home/root/.bashrc 183 echo "source /etc/nova/openrc" >> /root/.bashrc
186 echo "source /etc/nova/openrc" >> /home/root/.profile 184 echo "source /etc/nova/openrc" >> /root/.profile
187 else 185 fi
188 echo "source /etc/nova/openrc" >> /root/.bashrc
189 echo "source /etc/nova/openrc" >> /root/.profile
190 fi 186 fi
191} 187}
192 188