Merge lp:~lamont/maas/bug-1640147-2.1 into lp:maas/2.1

Proposed by LaMont Jones
Status: Merged
Approved by: LaMont Jones
Approved revision: no longer in the source branch.
Merged at revision: 5584
Proposed branch: lp:~lamont/maas/bug-1640147-2.1
Merge into: lp:maas/2.1
Diff against target: 67 lines (+18/-5)
2 files modified
src/provisioningserver/refresh/node_info_scripts.py (+8/-3)
src/provisioningserver/refresh/tests/test_node_info_scripts.py (+10/-2)
To merge this branch: bzr merge lp:~lamont/maas/bug-1640147-2.1
Reviewer Review Type Date Requested Status
LaMont Jones (community) Approve
Review via email: mp+317224@code.launchpad.net

Commit message

Backport r5724 from trunk: Do not attempt ipv6 discovery on interfaces where ipv6 is disabled.

Description of the change

Do not attempt ipv6 discovery on interfaces where ipv6 is disabled.

To post a comment you must log in.
Revision history for this message
LaMont Jones (lamont) wrote :

Trivial backport.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/provisioningserver/refresh/node_info_scripts.py'
2--- src/provisioningserver/refresh/node_info_scripts.py 2016-11-03 16:06:25 +0000
3+++ src/provisioningserver/refresh/node_info_scripts.py 2017-02-14 15:59:14 +0000
4@@ -130,11 +130,16 @@
5 return False
6
7 def has_ipv6_address(iface):
8+ no_ipv6_found = True
9 output = check_output(('ip', '-6', 'addr', 'list', 'dev', iface))
10 for line in output.splitlines():
11- if line.find(b' inet6 ') >= 0 and line.find(b' inet6 fe80:') == -1:
12- return True
13- return False
14+ if line.find(b' inet6 ') >= 0:
15+ if line.find(b' inet6 fe80:') == -1:
16+ return True
17+ no_ipv6_found = False
18+ # Bug 1640147: If there is no IPv6 address, then we consider this to be
19+ # a configured ipv6 interface, since ipv6 won't work there.
20+ return no_ipv6_found
21
22 all_ifaces = get_iface_list(check_output(("ifconfig", "-s", "-a")))
23 configured_ifaces = get_iface_list(check_output(("ifconfig", "-s")))
24
25=== modified file 'src/provisioningserver/refresh/tests/test_node_info_scripts.py'
26--- src/provisioningserver/refresh/tests/test_node_info_scripts.py 2016-11-03 18:32:09 +0000
27+++ src/provisioningserver/refresh/tests/test_node_info_scripts.py 2017-02-14 15:59:14 +0000
28@@ -216,6 +216,7 @@
29 eth1 1500 0 0 0 0 0 0 0
30 eth0 1500 0 1366127 0 0 0 831110 0
31 eth4 1500 0 0 0 0 0 0 0
32+eth5 1500 0 0 0 0 0 0 0
33 eth6 1500 0 0 0 0 0 0 0
34 lo 65536 0 38075 0 0 0 38075 0
35 virbr0 1500 0 0 0 0 0 0 0
36@@ -227,6 +228,7 @@
37 Iface MTU Met RX-OK RX-ERR RX-DRP RX-OVR TX-OK TX-ERR TX-DRP
38 eth0 1500 0 1366127 0 0 0 831110 0
39 eth4 1500 0 1366127 0 0 0 831110 0
40+eth5 1500 0 1366127 0 0 0 831110 0
41 eth6 1500 0 1366127 0 0 0 831110 0
42 lo 65536 0 38115 0 0 0 38115 0
43 virbr0 1500 0 0 0 0 0 0 0
44@@ -252,6 +254,12 @@
45 inet6 fe80::0201:02ff:fe03:0404/64 scope link
46 valid_lft forever preferred_lft forever
47 """
48+ip_eth5 = b"""\
49+6: eth5: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP ...
50+ link/ether 00:01:02:03:04:06 brd ff:ff:ff:ff:ff:ff
51+ inet 192.168.5.1/24 brd 192.168.4.255 scope global eth4
52+ valid_lft forever preferred_lft forever
53+"""
54 ip_eth6 = b"""\
55 6: eth6: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP ...
56 link/ether 00:01:02:03:04:06 brd ff:ff:ff:ff:ff:ff
57@@ -292,8 +300,8 @@
58 check_output = self.patch(subprocess, "check_output")
59 check_output.side_effect = [
60 ifconfig_all, ifconfig_config,
61- ip_eth0, ip_eth4, ip_eth6, ip_lo, ip_virbr0, ip_wlan0,
62- ip_eth0, ip_eth4, ip_eth6, ip_lo, ip_virbr0, ip_wlan0
63+ ip_eth0, ip_eth4, ip_eth5, ip_eth6, ip_lo, ip_virbr0, ip_wlan0,
64+ ip_eth0, ip_eth4, ip_eth5, ip_eth6, ip_lo, ip_virbr0, ip_wlan0
65 ]
66 mock_call = self.patch(subprocess, "call")
67 mock_popen = self.patch(subprocess, "Popen")

Subscribers

People subscribed via source and target branches

to all changes: