File: magnum-common.postinst.in

package info (click to toggle)
magnum 2.0.0-5~bpo8%2B1
  • links: PTS, VCS
  • area: main
  • in suites: jessie-backports
  • size: 5,572 kB
  • sloc: python: 42,786; sh: 1,915; makefile: 50
file content (32 lines) | stat: -rw-r--r-- 783 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/bin/sh

set -e

CONF=/etc/magnum/magnum.conf

#PKGOS-INCLUDE#

if [ "$1" = "configure" ] || [ "$1" = "reconfigure" ] ; then
	. /usr/share/debconf/confmodule
	. /usr/share/dbconfig-common/dpkg/postinst

	pkgos_var_user_group magnum

	pkgos_write_new_conf magnum magnum.conf
	pkgos_write_new_conf magnum policy.json
	pkgos_write_new_conf magnum api-paste.ini

	pkgos_rabbit_write_conf ${CONF} oslo_messaging_rabbit magnum
	pkgos_write_admin_creds ${CONF} keystone_authtoken magnum

	db_get magnum/configure_db
	if [ "$RET" = "true" ]; then
		pkgos_dbc_postinst ${CONF} database connection magnum $@
		echo "Now calling magnum-db-manage: this may take a while..."
		su -s /bin/sh -c 'magnum-db-manage --config-file=/etc/magnum/magnum.conf upgrade' magnum
	fi
fi

#DEBHELPER#

exit 0