Merge lp:~rodsmith/maas-cert-server/fix-deployment-failures into lp:~hardware-certification/maas-cert-server/trunk

Proposed by Rod Smith
Status: Merged
Approved by: Jeff Lane 
Approved revision: 53
Merged at revision: 53
Proposed branch: lp:~rodsmith/maas-cert-server/fix-deployment-failures
Merge into: lp:~hardware-certification/maas-cert-server/trunk
Diff against target: 71 lines (+29/-10)
3 files modified
debian/changelog (+5/-2)
preseed/curtin_userdata_cert (+12/-4)
preseed/curtin_userdata_ocp (+12/-4)
To merge this branch: bzr merge lp:~rodsmith/maas-cert-server/fix-deployment-failures
Reviewer Review Type Date Requested Status
Jeff Lane  Approve
Review via email: mp+292336@code.launchpad.net

Description of the change

Improve the preseed files' handling of /etc/network/interfaces by having them set the "auto" bringup option for a given interface if and only if the interface can be brought up via dhclient during deployment. If an interface exists but cannot be brought up in this way, its entry is created, but the "auto" option is commented out and a comment advising that cabling be checked is added. This should improve deployment reliability when only some NICs are cabled.

To post a comment you must log in.
Revision history for this message
Jeff Lane  (bladernr) wrote :

Thanks,

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/changelog'
2--- debian/changelog 2016-04-06 14:18:09 +0000
3+++ debian/changelog 2016-04-20 02:02:59 +0000
4@@ -1,9 +1,12 @@
5-maas-cert-server (0.2.16-0ppa1) UNRELEASED; urgency=medium
6+maas-cert-server (0.2.16-0ppa1) trusty; urgency=medium
7+
8+ * Fix preseeds so that they produce fewer deployment failures if one
9+ or more network ports are unplugged at time of deployment.
10
11 * Fix maniacs-setup to support a user home directory named other than
12 after the username
13
14- -- Rod Smith <rod.smith@canonical.com> Wed, 06 Apr 2016 10:15:32 -0400
15+ -- Rod Smith <rod.smith@canonical.com> Tue, 19 Apr 2016 14:29:07 -0400
16
17 maas-cert-server (0.2.15-0ppa1) trusty; urgency=medium
18
19
20=== modified file 'preseed/curtin_userdata_cert'
21--- preseed/curtin_userdata_cert 2016-03-25 19:17:12 +0000
22+++ preseed/curtin_userdata_cert 2016-04-20 02:02:59 +0000
23@@ -84,10 +84,18 @@
24 echo "# This file created by maas-cert-server curtin preseed script" > /etc/network/interfaces;
25 echo "auto lo" >> /etc/network/interfaces;
26 echo "iface lo inet loopback\n" >> /etc/network/interfaces;
27- echo "auto" >> /etc/network/interfaces;
28- for i in `ls /sys/class/net|sort |grep -v -E '(lo|wlan)'`; do
29- /bin/sed -i "/^[ \t]*auto lo.*/! { /^auto/ s/$/ $i/ }" /etc/network/interfaces ;
30- echo "iface $i inet dhcp" >> /etc/network/interfaces ;
31+ for i in `ls /sys/class/net|sort |grep -v -E '(lo|wlan)'`; do
32+ if [ `cat /sys/class/net/$i/operstate` != "up" ] ; then
33+ dhclient -nw $i ;
34+ sleep 15 ;
35+ if [ `cat /sys/class/net/$i/operstate` != "up" ] ; then
36+ echo "# $i available but inoperative; check its cabling and DHCP server!" >> /etc/network/interfaces ;
37+ echo -n "#" >> /etc/network/interfaces ;
38+ fi;
39+ dhclient -r $i ;
40+ fi;
41+ echo "auto $i" >> /etc/network/interfaces ;
42+ echo "iface $i inet dhcp\n" >> /etc/network/interfaces ;
43 done;
44 echo "Done.";
45
46
47=== modified file 'preseed/curtin_userdata_ocp'
48--- preseed/curtin_userdata_ocp 2016-03-21 16:58:29 +0000
49+++ preseed/curtin_userdata_ocp 2016-04-20 02:02:59 +0000
50@@ -71,10 +71,18 @@
51 echo "# This file created by maas-cert-server curtin preseed script" > /etc/network/interfaces
52 echo "auto lo" >> /etc/network/interfaces;
53 echo "iface lo inet loopback\n" >> /etc/network/interfaces;
54- echo "auto" >> /etc/network/interfaces;
55- for i in `ls /sys/class/net|sort |grep -v -E '(lo|wlan)'`; do
56- /bin/sed -i "/^[ \t]*auto lo.*/! { /^auto/ s/$/ $i/ }" /etc/network/interfaces
57- echo "iface $i inet dhcp" >> /etc/network/interfaces ;
58+ for i in `ls /sys/class/net|sort |grep -v -E '(lo|wlan)'`; do
59+ if [ `cat /sys/class/net/$i/operstate` != "up" ] ; then
60+ dhclient -nw $i ;
61+ sleep 15 ;
62+ if [ `cat /sys/class/net/$i/operstate` != "up" ] ; then
63+ echo "# $i available but inoperative; check its cabling and DHCP server!" >> /etc/network/interfaces ;
64+ echo -n "#" >> /etc/network/interfaces ;
65+ fi;
66+ dhclient -r $i ;
67+ fi;
68+ echo "auto $i" >> /etc/network/interfaces ;
69+ echo "iface $i inet dhcp\n" >> /etc/network/interfaces ;
70 done;
71 echo "Done.";
72

Subscribers

People subscribed via source and target branches

to status/vote changes: