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
=== modified file 'charmhelpers/contrib/openstack/context.py'
--- charmhelpers/contrib/openstack/context.py 2016-01-06 22:04:12 +0000
+++ charmhelpers/contrib/openstack/context.py 2016-01-29 09:13:52 +0000
@@ -1259,12 +1259,12 @@
1259 @property1259 @property
1260 def num_cpus(self):1260 def num_cpus(self):
1261 try:1261 try:
1262 from psutil import NUM_CPUS1262 from psutil import cpu_count
1263 except ImportError:1263 except ImportError:
1264 apt_install('python-psutil', fatal=True)1264 apt_install('python-psutil', fatal=True)
1265 from psutil import NUM_CPUS1265 from psutil import cpu_count
12661266
1267 return NUM_CPUS1267 return cpu_count()
12681268
1269 def __call__(self):1269 def __call__(self):
1270 multiplier = config('worker-multiplier') or 01270 multiplier = config('worker-multiplier') or 0

Subscribers

People subscribed via source and target branches