summaryrefslogtreecommitdiffstats
path: root/meta-openstack/recipes-devtools/python/python-keystone_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-keystone_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-keystone_git.bb')
-rw-r--r--meta-openstack/recipes-devtools/python/python-keystone_git.bb50
1 files changed, 25 insertions, 25 deletions
diff --git a/meta-openstack/recipes-devtools/python/python-keystone_git.bb b/meta-openstack/recipes-devtools/python/python-keystone_git.bb
index 79bd0c8..a26c9bf 100644
--- a/meta-openstack/recipes-devtools/python/python-keystone_git.bb
+++ b/meta-openstack/recipes-devtools/python/python-keystone_git.bb
@@ -189,28 +189,26 @@ role_tree_dn = ou=Roles,${LDAP_DN} \
189 189
190pkg_postinst_${SRCNAME}-setup () { 190pkg_postinst_${SRCNAME}-setup () {
191 # python-keystone postinst start 191 # python-keystone postinst start
192 if [ "x$D" != "x" ]; then 192 if [ -z "$D" ]; then
193 exit 1 193 # This is to make sure postgres is configured and running
194 fi 194 if ! pidof postmaster > /dev/null; then
195 195 /etc/init.d/postgresql-init
196 # This is to make sure postgres is configured and running 196 /etc/init.d/postgresql start
197 if ! pidof postmaster > /dev/null; then 197 sleep 2
198 /etc/init.d/postgresql-init 198 fi
199 /etc/init.d/postgresql start 199
200 sleep 2 200 # This is to make sure keystone is configured and running
201 fi 201 PIDFILE="/var/run/keystone-all.pid"
202 202 if [ -z `cat $PIDFILE 2>/dev/null` ]; then
203 # This is to make sure keystone is configured and running 203 sudo -u postgres createdb keystone
204 PIDFILE="/var/run/keystone-all.pid" 204 keystone-manage db_sync
205 if [ -z `cat $PIDFILE 2>/dev/null` ]; then 205 keystone-manage pki_setup --keystone-user=root --keystone-group=daemon
206 sudo -u postgres createdb keystone 206
207 keystone-manage db_sync 207 if ${@bb.utils.contains('DISTRO_FEATURES', 'OpenLDAP', 'true', 'false', d)}; then
208 keystone-manage pki_setup --keystone-user=root --keystone-group=daemon 208 /etc/init.d/openldap start
209 209 fi
210 if ${@bb.utils.contains('DISTRO_FEATURES', 'OpenLDAP', 'true', 'false', d)}; then 210 /etc/init.d/keystone start
211 /etc/init.d/openldap start 211 fi
212 fi
213 /etc/init.d/keystone start
214 fi 212 fi
215} 213}
216 214
@@ -219,9 +217,11 @@ pkg_postinst_${SRCNAME}-setup () {
219KEYSTONE_TOKEN_FLUSH_TIME ??= "0 0 */2 * *" 217KEYSTONE_TOKEN_FLUSH_TIME ??= "0 0 */2 * *"
220 218
221pkg_postinst_${SRCNAME}-cronjobs () { 219pkg_postinst_${SRCNAME}-cronjobs () {
222 # By default keystone expired tokens are not automatic removed out of the 220 if [ -z "$D" ]; then
223 # database. So we create a cronjob for cleaning these expired tokens. 221 # By default keystone expired tokens are not automatic removed out of the
224 echo "${KEYSTONE_TOKEN_FLUSH_TIME} root /usr/bin/keystone-manage token_flush" >> /etc/crontab 222 # database. So we create a cronjob for cleaning these expired tokens.
223 echo "${KEYSTONE_TOKEN_FLUSH_TIME} root /usr/bin/keystone-manage token_flush" >> /etc/crontab
224 fi
225} 225}
226 226
227PACKAGES += " ${SRCNAME}-tests ${SRCNAME} ${SRCNAME}-setup ${SRCNAME}-cronjobs" 227PACKAGES += " ${SRCNAME}-tests ${SRCNAME} ${SRCNAME}-setup ${SRCNAME}-cronjobs"