Merge lp:~mpontillo/maas/fix-map-interfaces-by-mac-failure-with-bond-driver-loaded-1.8 into lp:maas/1.8

Proposed by Mike Pontillo
Status: Merged
Approved by: Mike Pontillo
Approved revision: no longer in the source branch.
Merged at revision: 4005
Proposed branch: lp:~mpontillo/maas/fix-map-interfaces-by-mac-failure-with-bond-driver-loaded-1.8
Merge into: lp:maas/1.8
Diff against target: 28 lines (+7/-4)
1 file modified
etc/maas/templates/deployment-user-data/maas_configure_interfaces.py (+7/-4)
To merge this branch: bzr merge lp:~mpontillo/maas/fix-map-interfaces-by-mac-failure-with-bond-driver-loaded-1.8
Reviewer Review Type Date Requested Status
Ricardo Bánffy (community) Approve
Review via email: mp+262157@code.launchpad.net

Commit message

Backport 4025: Make map_interfaces_by_mac() more robust by ignoring files in /sys/class/net (objects that do not represent interfaces are not directories)

Description of the change

MAAS 1.8 version of this MP:

https://code.launchpad.net/~mpontillo/maas/fix-map-interfaces-by-mac-failure-with-bond-driver-loaded/+merge/262154

The unit tests fail as follows when the bonding driver is loaded, and no bond interfaces are configured:

http://paste.ubuntu.com/11727748/

I'm not certain, but I think this may fail in production if the bonding driver is loaded. If so, this is a critical bug that should be backported to 1.8.

To post a comment you must log in.
Revision history for this message
Raphaël Badin (rvb) wrote :

Generally, when you backport a fix to a stable branch:
a) make sure a critical bug is filed and get approval on the fact that the bug is critical
b) get the fix reviewed and landed in trunk first so that you only have to backport a single revision instead of working on two branches in parallel.

Revision history for this message
Mike Pontillo (mpontillo) wrote :

Investigation needed (copy/paste from other MP):

We need to tweak the preseed to load the bonding driver and make sure the deploy fails. If it fails (and this fixes the problem), we need to file a critical bug, link this branch, and add a mention to the 1.8.0 changelog.

Revision history for this message
Ricardo Bánffy (rbanffy) wrote :

Looks harmless

review: Approve
Revision history for this message
Raphaël Badin (rvb) wrote :

FWIW, this wasn't getting landed because the commit message was missing ;).

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'etc/maas/templates/deployment-user-data/maas_configure_interfaces.py'
2--- etc/maas/templates/deployment-user-data/maas_configure_interfaces.py 2015-05-07 18:14:38 +0000
3+++ etc/maas/templates/deployment-user-data/maas_configure_interfaces.py 2015-06-16 23:34:21 +0000
4@@ -26,7 +26,10 @@
5 __metaclass__ = type
6
7 from argparse import ArgumentParser
8-from errno import ENOENT
9+from errno import (
10+ ENOENT,
11+ ENOTDIR,
12+)
13 from logging import getLogger
14 from os import (
15 listdir,
16@@ -120,9 +123,9 @@
17 mac = read_file(
18 os.path.join('/sys/class/net', interface, 'address'))
19 except IOError as e:
20- # Tolerate file-not-found errors, to absorb any variability in
21- # the /sys/class/net API that doesn't concern us.
22- if e.errno != ENOENT:
23+ # Tolerate file or directory not found errors, to absorb any
24+ # variability in the /sys/class/net API that doesn't concern us.
25+ if e.errno != ENOENT and e.errno != ENOTDIR:
26 raise
27 else:
28 mac = normalise_mac(mac)

Subscribers

People subscribed via source and target branches

to all changes: