Merge lp:~smoser/maas/ipmi-locate-fallback into lp:~maas-committers/maas/trunk

Proposed by Scott Moser
Status: Merged
Approved by: Francis J. Lacoste
Approved revision: no longer in the source branch.
Merged at revision: 1264
Proposed branch: lp:~smoser/maas/ipmi-locate-fallback
Merge into: lp:~maas-committers/maas/trunk
Diff against target: 58 lines (+10/-0)
2 files modified
contrib/preseeds_v2/enlist_userdata (+5/-0)
etc/maas/commissioning-user-data (+5/-0)
To merge this branch: bzr merge lp:~smoser/maas/ipmi-locate-fallback
Reviewer Review Type Date Requested Status
Francis J. Lacoste (community) Approve
Review via email: mp+129202@code.launchpad.net

Commit message

if ipmi-locate fails, but /dev/ipmi[0-9] exists continue down ipmi path

on quantal, the version of ipmi-locate in freeipmi (1.1.5-3ubuntu2) was
failing to locate ipmi on armhf boards. ipmi-locate did produce a postive
result on precise (0.8.12-3ubuntu1).

This works around that, and continues down the path if the /dev/ipmi
device is present.

Also, added here is a 'udevadm settle', which is really required any time
you load a module to prevent a race condition before attempting to access
the named device.

It would seem likelyhood of false positive here is very small, and at
this point it would seem that the end result would be a node enlisted
with empty power settings.

Description of the change

if ipmi-locate fails, but /dev/ipmi[0-9] exists continue down ipmi path

on quantal, the version of ipmi-locate in freeipmi (1.1.5-3ubuntu2) was
failing to locate ipmi on armhf boards. ipmi-locate did produce a postive
result on precise (0.8.12-3ubuntu1).

This works around that, and continues down the path if the /dev/ipmi
device is present.

Also, added here is a 'udevadm settle', which is really required any time
you load a module to prevent a race condition before attempting to access
the named device.

It would seem likelyhood of false positive here is very small, and at
this point it would seem that the end result would be a node enlisted
with empty power settings.

To post a comment you must log in.
Revision history for this message
Francis J. Lacoste (flacoste) wrote :

Looks good to me

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'contrib/preseeds_v2/enlist_userdata'
2--- contrib/preseeds_v2/enlist_userdata 2012-10-11 08:58:04 +0000
3+++ contrib/preseeds_v2/enlist_userdata 2012-10-11 14:01:22 +0000
4@@ -28,6 +28,7 @@
5 modprobe ipmi_msghandler
6 modprobe ipmi_devintf
7 modprobe ipmi_si ${IPMI_SI_PARAMS}
8+ udevadm settle
9 }
10
11 add_bin() {
12@@ -62,6 +63,7 @@
13 #!/usr/bin/python
14 import os
15 import commands
16+ import glob
17 import re
18 import string
19 import random
20@@ -74,6 +76,9 @@
21 show_re = re.compile('(IPMI\ Version:) (\d\.\d)')
22 res = show_re.search(output)
23 if res == None:
24+ found = glob.glob("/dev/ipmi[0-9]")
25+ if len(found):
26+ return (True, "UNKNOWN: %s" % " ".join(found))
27 return (False, "")
28 return (True, res.group(2))
29
30
31=== modified file 'etc/maas/commissioning-user-data'
32--- etc/maas/commissioning-user-data 2012-10-10 14:05:51 +0000
33+++ etc/maas/commissioning-user-data 2012-10-11 14:01:22 +0000
34@@ -189,6 +189,7 @@
35 modprobe ipmi_msghandler
36 modprobe ipmi_devintf
37 modprobe ipmi_si ${IPMI_SI_PARAMS}
38+ udevadm settle
39 }
40
41 ### begin writing files ###
42@@ -220,6 +221,7 @@
43 #!/usr/bin/python
44 import os
45 import commands
46+import glob
47 import re
48 import string
49 import random
50@@ -231,6 +233,9 @@
51 show_re = re.compile('(IPMI\ Version:) (\d\.\d)')
52 res = show_re.search(output)
53 if res == None:
54+ found = glob.glob("/dev/ipmi[0-9]")
55+ if len(found):
56+ return (True, "UNKNOWN: %s" % " ".join(found))
57 return (False, "")
58 return (True, res.group(2))
59