Merge lp:~andreserl/maas/packaging_default_url_preseed into lp:~maas-maintainers/maas/packaging

Proposed by Andres Rodriguez
Status: Merged
Approved by: Andres Rodriguez
Approved revision: 214
Merged at revision: 213
Proposed branch: lp:~andreserl/maas/packaging_default_url_preseed
Merge into: lp:~maas-maintainers/maas/packaging
Diff against target: 58 lines (+22/-8)
2 files modified
debian/changelog (+4/-0)
debian/maas-region-controller.postinst (+18/-8)
To merge this branch: bzr merge lp:~andreserl/maas/packaging_default_url_preseed
Reviewer Review Type Date Requested Status
Andres Rodriguez (community) Approve
Diogo Matsubara (community) Approve
Review via email: mp+195074@code.launchpad.net

Commit message

debian/maas-region-controller.postinst: Allo default-maas-url debconf
option to be preseeded.

To post a comment you must log in.
Revision history for this message
Diogo Matsubara (matsubara) wrote :

Looks good to me. The only additional thing I'd do is to update the comment to explain that we use the preseeded value if it's there, if not we use the default route one.

review: Approve
214. By Andres Rodriguez

update

Revision history for this message
Andres Rodriguez (andreserl) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'debian/changelog'
--- debian/changelog 2013-10-11 14:14:57 +0000
+++ debian/changelog 2013-11-13 15:08:45 +0000
@@ -5,6 +5,10 @@
5 [ Jeroen Vermeulen ]5 [ Jeroen Vermeulen ]
6 * Keep legacy import_ephemerals config for now.6 * Keep legacy import_ephemerals config for now.
77
8 [ Andres Rodriguez ]
9 * debian/maas-region-controller.postinst: Allo default-maas-url debconf
10 option to be preseeded.
11
8 -- Andres Rodriguez <andreserl@ubuntu.com> Thu, 10 Oct 2013 17:07:51 -040012 -- Andres Rodriguez <andreserl@ubuntu.com> Thu, 10 Oct 2013 17:07:51 -0400
913
10maas (1.4+bzr1693+dfsg-0ubuntu1) saucy; urgency=low14maas (1.4+bzr1693+dfsg-0ubuntu1) saucy; urgency=low
1115
=== modified file 'debian/maas-region-controller.postinst'
--- debian/maas-region-controller.postinst 2013-08-08 19:14:07 +0000
+++ debian/maas-region-controller.postinst 2013-11-13 15:08:45 +0000
@@ -120,6 +120,17 @@
120 fi120 fi
121}121}
122122
123get_default_route_ip() {
124 while read Iface Destination Gateway Flags RefCnt Use Metric Mask MTU Window IRTT; do
125 [ "$Mask" = "00000000" ] && break
126 done < /proc/net/route
127 interface="$Iface"
128 ipaddr=$(LC_ALL=C /sbin/ip -4 addr list dev "$interface" scope global)
129 ipaddr=${ipaddr#* inet }
130 ipaddr=${ipaddr%%/*}
131 echo $ipaddr
132}
133
123configure_maas_squid_deb_proxy() {134configure_maas_squid_deb_proxy() {
124 local ipaddr="$1"135 local ipaddr="$1"
125136
@@ -158,14 +169,13 @@
158 ########## Configure DEFAULT_MAAS_URL #################169 ########## Configure DEFAULT_MAAS_URL #################
159 #########################################################170 #########################################################
160171
161 # Obtain IP address of default route and change DEFAULT_MAAS_URL.172 # Obtain IP address of default route and change DEFAULT_MAAS_URL
162 while read Iface Destination Gateway Flags RefCnt Use Metric Mask MTU Window IRTT; do173 # if default-maas-url has not been preseeded.
163 [ "$Mask" = "00000000" ] && break174 db_get maas/default-maas-url
164 done < /proc/net/route175 ipaddr="$RET"
165 interface="$Iface"176 if [ -z "$RET" ]; then
166 ipaddr=$(LC_ALL=C /sbin/ip -4 addr list dev "$interface" scope global)177 ipaddr=$(get_default_route_ip)
167 ipaddr=${ipaddr#* inet }178 fi
168 ipaddr=${ipaddr%%/*}
169 # Set the IP address of the interface with default route179 # Set the IP address of the interface with default route
170 if [ -n "$ipaddr" ]; then180 if [ -n "$ipaddr" ]; then
171 configure_maas_default_url "$ipaddr"181 configure_maas_default_url "$ipaddr"

Subscribers

People subscribed via source and target branches

to all changes: