Merge lp:~thedac/charm-helpers/lp1537155 into lp:charm-helpers

Proposed by James Page
Status: Rejected
Rejected by: James Page
Proposed branch: lp:~thedac/charm-helpers/lp1537155
Merge into: lp:charm-helpers
Diff against target: 19 lines (+3/-3)
1 file modified
charmhelpers/contrib/openstack/context.py (+3/-3)
To merge this branch: bzr merge lp:~thedac/charm-helpers/lp1537155
Reviewer Review Type Date Requested Status
charmers Pending
Review via email: mp+284408@code.launchpad.net
To post a comment you must log in.
Revision history for this message
James Page (james-page) wrote :

cpu_count is not supported on earlier versions of psutil.

Unmerged revisions

523. By David Ames

Fix Bug#1537155 Use cpu_count() rather than NUM_CPU

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'charmhelpers/contrib/openstack/context.py'
2--- charmhelpers/contrib/openstack/context.py 2016-01-06 22:04:12 +0000
3+++ charmhelpers/contrib/openstack/context.py 2016-01-29 09:13:52 +0000
4@@ -1259,12 +1259,12 @@
5 @property
6 def num_cpus(self):
7 try:
8- from psutil import NUM_CPUS
9+ from psutil import cpu_count
10 except ImportError:
11 apt_install('python-psutil', fatal=True)
12- from psutil import NUM_CPUS
13+ from psutil import cpu_count
14
15- return NUM_CPUS
16+ return cpu_count()
17
18 def __call__(self):
19 multiplier = config('worker-multiplier') or 0

Subscribers

People subscribed via source and target branches