diff -Nru maas-0.1+bzr415+dfsg/debian/changelog maas-0.1+bzr415+dfsg/debian/changelog --- maas-0.1+bzr415+dfsg/debian/changelog 2012-04-04 23:11:25.000000000 +0000 +++ maas-0.1+bzr415+dfsg/debian/changelog 2012-04-06 20:03:41.000000000 +0000 @@ -1,3 +1,12 @@ +maas (0.1+bzr415+dfsg-0ubuntu2) precise; urgency=low + + * debian/maas-dhcp.{config,postinst}: + - Fix not setting new values on fresh install. (LP: #975321) + - Fix unsetting domain, otherwise, even if disabled, it will always be set. + * debian/control: Depends on maas for maas-dhcp. + + -- Andres Rodriguez Fri, 06 Apr 2012 15:30:44 -0400 + maas (0.1+bzr415+dfsg-0ubuntu1) precise; urgency=low * debian/control: Update package descriptions; Suggests maas-dhcp for maas diff -Nru maas-0.1+bzr415+dfsg/debian/control maas-0.1+bzr415+dfsg/debian/control --- maas-0.1+bzr415+dfsg/debian/control 2012-04-04 23:11:25.000000000 +0000 +++ maas-0.1+bzr415+dfsg/debian/control 2012-04-06 20:03:41.000000000 +0000 @@ -70,7 +70,7 @@ Package: maas-dhcp Architecture: all -Depends: dnsmasq +Depends: maas, dnsmasq Description: Ubuntu MAAS Server - DHCP configuration Ubuntu MAAS Server is the successor to Orchestra. It offers a nice UI to provision your Ubuntu servers. Each physical server diff -Nru maas-0.1+bzr415+dfsg/debian/maas-dhcp.config maas-0.1+bzr415+dfsg/debian/maas-dhcp.config --- maas-0.1+bzr415+dfsg/debian/maas-dhcp.config 2012-04-04 23:11:25.000000000 +0000 +++ maas-0.1+bzr415+dfsg/debian/maas-dhcp.config 2012-04-06 20:03:41.000000000 +0000 @@ -4,11 +4,11 @@ if ([ "$1" = "configure" ] && [ -z "$2" ]) || [ "$1" = "reconfigure" ]; then . /usr/share/debconf/confmodule - # Try to obtain the default range for dnsmasq-dhcp-range and set it - range=$(grep -s "^dhcp-range=.*$" /etc/cobbler/dnsmasq.template | awk '{split($0,array,"=")} END{print array[2]}') - if [ -n "$range" ]; then - db_set maas-dhcp/dnsmasq-dhcp-range "$range" - fi + # Try to obtain the default range for dnsmasq-dhcp-range and set it + range=$(grep -s "^dhcp-range=.*$" /etc/cobbler/dnsmasq.template | awk '{split($0,array,"=")} END{print array[2]}') + if [ -n "$range" ]; then + db_set maas-dhcp/dnsmasq-dhcp-range "$range" + fi # try to obtain the default gateway and set it gateway=$(grep -s "^dhcp-option=.*$" /etc/cobbler/dnsmasq.template | awk '{split($0,array,"3,")} END{print array[2]}') @@ -21,17 +21,10 @@ fi # try to obtain the domain and set it - domain=$(grep -s "^domain=.*$" /etc/cobbler/dnsmasq.template | awk '{split($0,array,"=")} END{print array[2]}') - if [ -n "$domain" ]; then - db_set maas-dhcp/dnsmasq-domain-name "$domain" - fi - - db_input high maas-dhcp/dnsmasq-dhcp-range || true - db_go - db_input high maas-dhcp/dnsmasq-default-gateway || true - db_go - db_input high maas-dhcp/dnsmasq-domain-name || true - db_go + domain=$(grep -s "^domain=.*$" /etc/cobbler/dnsmasq.template | awk '{split($0,array,"=")} END{print array[2]}') + if [ -n "$domain" ]; then + db_set maas-dhcp/dnsmasq-domain-name "$domain" + fi fi #DEBHELPER# diff -Nru maas-0.1+bzr415+dfsg/debian/maas-dhcp.postinst maas-0.1+bzr415+dfsg/debian/maas-dhcp.postinst --- maas-0.1+bzr415+dfsg/debian/maas-dhcp.postinst 2012-04-04 23:11:25.000000000 +0000 +++ maas-0.1+bzr415+dfsg/debian/maas-dhcp.postinst 2012-04-06 20:03:41.000000000 +0000 @@ -4,6 +4,12 @@ db_version 2.0 if ([ "$1" = "configure" ] && [ -z "$2" ]) || [ "$1" = "reconfigure" ] || [ -n "$DEBCONF_RECONFIGURE" ]; then + db_input high maas-dhcp/dnsmasq-dhcp-range || true + db_go + db_input high maas-dhcp/dnsmasq-default-gateway || true + db_go + db_input high maas-dhcp/dnsmasq-domain-name || true + db_go # Setup dnsmasq sed -i -e "s/^manage_dns:.*$/manage_dns: 1/" \ @@ -39,6 +45,11 @@ elif grep -qs "^domain=.*$" /etc/cobbler/dnsmasq.template; then sed -i -e "s/^domain=.*$/domain=$domain/" /etc/cobbler/dnsmasq.template fi + elif [ -z "$domain" ]; then + # if the domain has been set to empty, then disable it + if grep -qs "^domain=.*$" /etc/cobbler/dnsmasq.template; then + sed -i -e "s/^domain=.*$/#domain=/" /etc/cobbler/dnsmasq.template + fi fi if [ -x /usr/sbin/invoke-rc.d ]; then invoke-rc.d cobbler restart || true