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

Proposed by Julian Edwards
Status: Merged
Approved by: Julian Edwards
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
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.
Revision history for this message
Julian Edwards (julian-edwards) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'contrib/preseeds_v2/enlist_userdata'
--- contrib/preseeds_v2/enlist_userdata 2013-02-27 15:43:02 +0000
+++ contrib/preseeds_v2/enlist_userdata 2013-05-28 01:48:35 +0000
@@ -63,7 +63,13 @@
63 import json63 import json
6464
65 def detect_ipmi():65 def detect_ipmi():
66 # TODO: Detection could be improved.66 # XXX: andreserl 2013-04-09 bug=1064527: Try to detect if node
67 # is a Virtual Machine. If it is, do not try to detect IPMI.
68 with open('/proc/cpuinfo', 'r') as cpuinfo:
69 for line in cpuinfo:
70 if line.startswith('model name') and 'QEMU' in line:
71 return (False, None)
72
67 (status, output) = commands.getstatusoutput('ipmi-locate')73 (status, output) = commands.getstatusoutput('ipmi-locate')
68 show_re = re.compile('(IPMI\ Version:) (\d\.\d)')74 show_re = re.compile('(IPMI\ Version:) (\d\.\d)')
69 res = show_re.search(output)75 res = show_re.search(output)
7076
=== modified file 'etc/maas/commissioning-user-data'
--- etc/maas/commissioning-user-data 2013-02-27 15:43:02 +0000
+++ etc/maas/commissioning-user-data 2013-05-28 01:48:35 +0000
@@ -220,7 +220,13 @@
220import time220import time
221221
222def detect_ipmi():222def detect_ipmi():
223 # TODO: Detection could be improved.223 # XXX: andreserl 2013-04-09 bug=1064527: Try to detect if node
224 # is a Virtual Machine. If it is, do not try to detect IPMI.
225 with open('/proc/cpuinfo', 'r') as cpuinfo:
226 for line in cpuinfo:
227 if line.startswith('model name') and 'QEMU' in line:
228 return (False, None)
229
224 (status, output) = commands.getstatusoutput('ipmi-locate')230 (status, output) = commands.getstatusoutput('ipmi-locate')
225 show_re = re.compile('(IPMI\ Version:) (\d\.\d)')231 show_re = re.compile('(IPMI\ Version:) (\d\.\d)')
226 res = show_re.search(output)232 res = show_re.search(output)

Subscribers

People subscribed via source and target branches

to status/vote changes: