~ubuntu-branches/ubuntu/saucy/maas/saucy-updates

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
#!/bin/sh

set -e

. /usr/share/debconf/confmodule
db_version 2.0

# Only ask for new installations and reconfiguring.
# XXX Fix to not ask when installing from the CD.
if ([ "$1" = "configure" ] && [ -z "$2" ]); then

    db_get maas-cluster-controller/maas-url || true
    if [ -z "$RET" ]; then
        # Attempt to pre-populate if installing on the region controller.
        if [ -e /etc/maas/maas_local_settings.py ]; then
            url=$(awk '$1 == "DEFAULT_MAAS_URL" { split($0,array,"\"")} END{print array[2] }' /etc/maas/maas_local_settings.py)
            # If the URL doesn't end in /MAAS then add it. This helps upgrades from
            # precise for which the URL didn't contain /MAAS, which is now required
            if ! echo $url | grep -qs "/MAAS$"; then
                url="${url}/MAAS"
            fi
            db_set maas-cluster-controller/maas-url "$url"
        else
            # Will only get here if dbconf value not already set, or
            # /etc/maas/maas_local_settings.py doesn't exist.
            db_input medium maas-cluster-controller/maas-url || true
            db_go
        fi
    fi
fi

if [ "$1" = "reconfigure" ]; then
    db_input high maas-cluster-controller/maas-url || true
    db_go
fi
#DEBHELPER#