File: python-murano-dashboard.postinst

package info (click to toggle)
murano-dashboard 1%3A3.0.0-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 1,564 kB
  • ctags: 1,442
  • sloc: python: 7,611; sh: 99; makefile: 29
file content (43 lines) | stat: -rw-r--r-- 1,246 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
33
34
35
36
37
38
39
40
41
42
43
#!/bin/sh

set -e

if [ "$1" = "configure" ] ; then
	/usr/share/openstack-dashboard/manage.py collectstatic --clear --noinput

	# Compress the JS and CSS with python-compressor and python-lesscpy
	/usr/share/openstack-dashboard/manage.py compress --force

	if [ -f /var/lib/openstack-dashboard/secret-key/.secret_key_store ]; then
		rm /var/lib/openstack-dashboard/secret-key/.secret_key_store
	fi

	if [ -d /var/lib/openstack-dashboard/secret-key ]; then
		chown -R www-data /var/lib/openstack-dashboard/secret-key
	fi

	if [ -d /var/lib/openstack-dashboard/static ]; then
		chown -R www-data /var/lib/openstack-dashboard/static
	fi

	DSHB_SETTINGS_LOC='/etc/openstack-dashboard/local_settings.py'
	if [ -f "$DSHB_SETTINGS_LOC" ]; then
		mkdir -p /var/cache/murano-dashboard
		chown -R horizon:www-data /var/cache/murano-dashboard
		chmod 775 /var/cache/murano-dashboard

		if grep -Eq '^METADATA_CACHE_DIR=' $DSHB_SETTINGS_LOC; then
			sed -i '/^METADATA_CACHE_DIR=/{s#.*#METADATA_CACHE_DIR="/var/cache/murano-dashboard"#}' $DSHB_SETTINGS_LOC
		else
			sed -i '$aMETADATA_CACHE_DIR="/var/cache/murano-dashboard"' $DSHB_SETTINGS_LOC
		fi
	fi

	if [ -x /etc/init.d/apache2 ]; then
		invoke-rc.d --quiet apache2 reload
	fi
fi

#DEBHELPER#

exit 0