From 3051160f23fe8e06e545859538c86ef3a3c39d7a Mon Sep 17 00:00:00 2001 From: Mark Asselstine Date: Wed, 15 Nov 2017 12:59:53 -0500 Subject: 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 Signed-off-by: Bruce Ashfield --- .../recipes-devtools/python/python-neutron_git.bb | 32 ++++++++++------------ 1 file changed, 14 insertions(+), 18 deletions(-) (limited to 'meta-openstack/recipes-devtools/python/python-neutron_git.bb') diff --git a/meta-openstack/recipes-devtools/python/python-neutron_git.bb b/meta-openstack/recipes-devtools/python/python-neutron_git.bb index 51c2ac4..c837401 100644 --- a/meta-openstack/recipes-devtools/python/python-neutron_git.bb +++ b/meta-openstack/recipes-devtools/python/python-neutron_git.bb @@ -138,29 +138,25 @@ do_install_append() { } pkg_postinst_${SRCNAME}-setup () { - if [ "x$D" != "x" ]; then - exit 1 + if [ -z "$D" ]; then + # This is to make sure postgres is configured and running + if ! pidof postmaster > /dev/null; then + /etc/init.d/postgresql-init + /etc/init.d/postgresql start + sleep 2 + fi + + sudo -u postgres createdb neutron + sudo neutron-db-manage --config-file /etc/neutron/neutron.conf \ + --config-file /etc/neutron/plugins/ml2/ml2_conf.ini upgrade head fi - - # This is to make sure postgres is configured and running - if ! pidof postmaster > /dev/null; then - /etc/init.d/postgresql-init - /etc/init.d/postgresql start - sleep 2 - fi - - sudo -u postgres createdb neutron - sudo neutron-db-manage --config-file /etc/neutron/neutron.conf \ - --config-file /etc/neutron/plugins/ml2/ml2_conf.ini upgrade head } pkg_postinst_${SRCNAME}-plugin-openvswitch-setup () { - if [ "x$D" != "x" ]; then - exit 1 + if [ -z "$D" ]; then + /etc/init.d/openvswitch-switch start + ovs-vsctl --no-wait -- --may-exist add-br br-int fi - - /etc/init.d/openvswitch-switch start - ovs-vsctl --no-wait -- --may-exist add-br br-int } ALLOW_EMPTY_${SRCNAME}-setup = "1" -- cgit v1.2.3-54-g00ecf