diff options
Diffstat (limited to 'meta-openstack/recipes-devtools/python/python-keystone_git.bb')
| -rw-r--r-- | meta-openstack/recipes-devtools/python/python-keystone_git.bb | 50 |
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 | ||
| 190 | pkg_postinst_${SRCNAME}-setup () { | 190 | pkg_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 () { | |||
| 219 | KEYSTONE_TOKEN_FLUSH_TIME ??= "0 0 */2 * *" | 217 | KEYSTONE_TOKEN_FLUSH_TIME ??= "0 0 */2 * *" |
| 220 | 218 | ||
| 221 | pkg_postinst_${SRCNAME}-cronjobs () { | 219 | pkg_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 | ||
| 227 | PACKAGES += " ${SRCNAME}-tests ${SRCNAME} ${SRCNAME}-setup ${SRCNAME}-cronjobs" | 227 | PACKAGES += " ${SRCNAME}-tests ${SRCNAME} ${SRCNAME}-setup ${SRCNAME}-cronjobs" |
