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
=== modified file 'src/provisioningserver/refresh/node_info_scripts.py'
--- src/provisioningserver/refresh/node_info_scripts.py 2016-11-03 16:06:25 +0000
+++ src/provisioningserver/refresh/node_info_scripts.py 2017-02-14 15:59:14 +0000
@@ -130,11 +130,16 @@
130 return False130 return False
131131
132 def has_ipv6_address(iface):132 def has_ipv6_address(iface):
133 no_ipv6_found = True
133 output = check_output(('ip', '-6', 'addr', 'list', 'dev', iface))134 output = check_output(('ip', '-6', 'addr', 'list', 'dev', iface))
134 for line in output.splitlines():135 for line in output.splitlines():
135 if line.find(b' inet6 ') >= 0 and line.find(b' inet6 fe80:') == -1:136 if line.find(b' inet6 ') >= 0:
136 return True137 if line.find(b' inet6 fe80:') == -1:
137 return False138 return True
139 no_ipv6_found = False
140 # Bug 1640147: If there is no IPv6 address, then we consider this to be
141 # a configured ipv6 interface, since ipv6 won't work there.
142 return no_ipv6_found
138143
139 all_ifaces = get_iface_list(check_output(("ifconfig", "-s", "-a")))144 all_ifaces = get_iface_list(check_output(("ifconfig", "-s", "-a")))
140 configured_ifaces = get_iface_list(check_output(("ifconfig", "-s")))145 configured_ifaces = get_iface_list(check_output(("ifconfig", "-s")))
141146
=== modified file 'src/provisioningserver/refresh/tests/test_node_info_scripts.py'
--- src/provisioningserver/refresh/tests/test_node_info_scripts.py 2016-11-03 18:32:09 +0000
+++ src/provisioningserver/refresh/tests/test_node_info_scripts.py 2017-02-14 15:59:14 +0000
@@ -216,6 +216,7 @@
216eth1 1500 0 0 0 0 0 0 0216eth1 1500 0 0 0 0 0 0 0
217eth0 1500 0 1366127 0 0 0 831110 0217eth0 1500 0 1366127 0 0 0 831110 0
218eth4 1500 0 0 0 0 0 0 0218eth4 1500 0 0 0 0 0 0 0
219eth5 1500 0 0 0 0 0 0 0
219eth6 1500 0 0 0 0 0 0 0220eth6 1500 0 0 0 0 0 0 0
220lo 65536 0 38075 0 0 0 38075 0221lo 65536 0 38075 0 0 0 38075 0
221virbr0 1500 0 0 0 0 0 0 0222virbr0 1500 0 0 0 0 0 0 0
@@ -227,6 +228,7 @@
227Iface MTU Met RX-OK RX-ERR RX-DRP RX-OVR TX-OK TX-ERR TX-DRP228Iface MTU Met RX-OK RX-ERR RX-DRP RX-OVR TX-OK TX-ERR TX-DRP
228eth0 1500 0 1366127 0 0 0 831110 0229eth0 1500 0 1366127 0 0 0 831110 0
229eth4 1500 0 1366127 0 0 0 831110 0230eth4 1500 0 1366127 0 0 0 831110 0
231eth5 1500 0 1366127 0 0 0 831110 0
230eth6 1500 0 1366127 0 0 0 831110 0232eth6 1500 0 1366127 0 0 0 831110 0
231lo 65536 0 38115 0 0 0 38115 0233lo 65536 0 38115 0 0 0 38115 0
232virbr0 1500 0 0 0 0 0 0 0234virbr0 1500 0 0 0 0 0 0 0
@@ -252,6 +254,12 @@
252 inet6 fe80::0201:02ff:fe03:0404/64 scope link254 inet6 fe80::0201:02ff:fe03:0404/64 scope link
253 valid_lft forever preferred_lft forever255 valid_lft forever preferred_lft forever
254"""256"""
257ip_eth5 = b"""\
2586: eth5: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP ...
259 link/ether 00:01:02:03:04:06 brd ff:ff:ff:ff:ff:ff
260 inet 192.168.5.1/24 brd 192.168.4.255 scope global eth4
261 valid_lft forever preferred_lft forever
262"""
255ip_eth6 = b"""\263ip_eth6 = b"""\
2566: eth6: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP ...2646: eth6: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP ...
257 link/ether 00:01:02:03:04:06 brd ff:ff:ff:ff:ff:ff265 link/ether 00:01:02:03:04:06 brd ff:ff:ff:ff:ff:ff
@@ -292,8 +300,8 @@
292 check_output = self.patch(subprocess, "check_output")300 check_output = self.patch(subprocess, "check_output")
293 check_output.side_effect = [301 check_output.side_effect = [
294 ifconfig_all, ifconfig_config,302 ifconfig_all, ifconfig_config,
295 ip_eth0, ip_eth4, ip_eth6, ip_lo, ip_virbr0, ip_wlan0,303 ip_eth0, ip_eth4, ip_eth5, ip_eth6, ip_lo, ip_virbr0, ip_wlan0,
296 ip_eth0, ip_eth4, ip_eth6, ip_lo, ip_virbr0, ip_wlan0304 ip_eth0, ip_eth4, ip_eth5, ip_eth6, ip_lo, ip_virbr0, ip_wlan0
297 ]305 ]
298 mock_call = self.patch(subprocess, "call")306 mock_call = self.patch(subprocess, "call")
299 mock_popen = self.patch(subprocess, "Popen")307 mock_popen = self.patch(subprocess, "Popen")

Subscribers

People subscribed via source and target branches

to all changes: