Merge lp:~andreserl/maas/maas_detect_ipmi_bug1064527 into lp:~maas-committers/maas/trunk
Proposed by
Andres Rodriguez
Status: | Merged |
---|---|
Approved by: | Julian Edwards |
Approved revision: | no longer in the source branch. |
Merged at revision: | 1461 |
Proposed branch: | lp:~andreserl/maas/maas_detect_ipmi_bug1064527 |
Merge into: | lp:~maas-committers/maas/trunk |
Diff against target: |
37 lines (+14/-2) 2 files modified
contrib/preseeds_v2/enlist_userdata (+7/-1) src/metadataserver/commissioning/user_data.template (+7/-1) |
To merge this branch: | bzr merge lp:~andreserl/maas/maas_detect_ipmi_bug1064527 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Gavin Panella (community) | Approve | ||
Review via email: mp+157944@code.launchpad.net |
Commit message
Improve detect_ipmi to avoid trying to detect IPMI if host is a virtual CPU
To post a comment you must log in.
[1]
+ f = open('/ proc/cpuinfo' , 'r') ('model name') and 'QEMU' in line:
+ cpu_info = f.readlines()
+ f.close()
+ for line in cpu_info:
+ if line.startswith
+ return (False, None)
The idiomatic way to do this in recent Python versions is:
with open('/ proc/cpuinfo' , 'r') as fd: ('model name') and 'QEMU' in line:
return (False, None)
for line in fd:
if line.startswith
Same for the other copy-n-pasted version of this function :-/