Merge lp:~julian-edwards/maas/1.2-ipmi-backport into lp:maas/1.2

Proposed by Julian Edwards on 2013-05-28
Status: Merged
Approved by: Julian Edwards on 2013-05-28
Approved revision: 1377
Merged at revision: 1377
Proposed branch: lp:~julian-edwards/maas/1.2-ipmi-backport
Merge into: lp:maas/1.2
Diff against target: 37 lines (+14/-2)
2 files modified
contrib/preseeds_v2/enlist_userdata (+7/-1)
etc/maas/commissioning-user-data (+7/-1)
To merge this branch: bzr merge lp:~julian-edwards/maas/1.2-ipmi-backport
Reviewer Review Type Date Requested Status
Julian Edwards (community) Approve on 2013-05-28
Review via email: mp+165952@code.launchpad.net

Commit message

backport r1461 from trunk: Improve detect_ipmi to avoid trying to detect IPMI if host is a virtual CPU

To post a comment you must log in.
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 2013-02-27 15:43:02 +0000
3+++ contrib/preseeds_v2/enlist_userdata 2013-05-28 01:48:35 +0000
4@@ -63,7 +63,13 @@
5 import json
6
7 def detect_ipmi():
8- # TODO: Detection could be improved.
9+ # XXX: andreserl 2013-04-09 bug=1064527: Try to detect if node
10+ # is a Virtual Machine. If it is, do not try to detect IPMI.
11+ with open('/proc/cpuinfo', 'r') as cpuinfo:
12+ for line in cpuinfo:
13+ if line.startswith('model name') and 'QEMU' in line:
14+ return (False, None)
15+
16 (status, output) = commands.getstatusoutput('ipmi-locate')
17 show_re = re.compile('(IPMI\ Version:) (\d\.\d)')
18 res = show_re.search(output)
19
20=== modified file 'etc/maas/commissioning-user-data'
21--- etc/maas/commissioning-user-data 2013-02-27 15:43:02 +0000
22+++ etc/maas/commissioning-user-data 2013-05-28 01:48:35 +0000
23@@ -220,7 +220,13 @@
24 import time
25
26 def detect_ipmi():
27- # TODO: Detection could be improved.
28+ # XXX: andreserl 2013-04-09 bug=1064527: Try to detect if node
29+ # is a Virtual Machine. If it is, do not try to detect IPMI.
30+ with open('/proc/cpuinfo', 'r') as cpuinfo:
31+ for line in cpuinfo:
32+ if line.startswith('model name') and 'QEMU' in line:
33+ return (False, None)
34+
35 (status, output) = commands.getstatusoutput('ipmi-locate')
36 show_re = re.compile('(IPMI\ Version:) (\d\.\d)')
37 res = show_re.search(output)

Subscribers

People subscribed via source and target branches

to status/vote changes: