Merge lp:~andreserl/maas/maas_detect_ipmi_bug1064527 into lp:maas/trunk
Proposed by
Andres Rodriguez
on 2013-04-09
Status: | Merged |
---|---|
Approved by: | Julian Edwards on 2013-04-10 |
Approved revision: | 1462 |
Merged at revision: | 1461 |
Proposed branch: | lp:~andreserl/maas/maas_detect_ipmi_bug1064527 |
Merge into: | lp: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) | 2013-04-09 | Approve on 2013-04-09 | |
Review via email:
|
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.
Andres Rodriguez (andreserl) wrote : | # |
Hi Gavin,
Thanks for the review. I updated the branch to display the idiomatic as recommended.
Regards.
review:
Approve
Julian Edwards (julian-edwards) wrote : | # |
On 10/04/13 06:41, Gavin Panella wrote:
> Same for the other copy-n-pasted version of this function :-/
Andres, I hate to say I told you so, but.... this really needs factoring.
MAAS Lander (maas-lander) wrote : | # |
No commit message specified.
[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:
for line in fd:
if line.startswith
return (False, None)
Same for the other copy-n-pasted version of this function :-/