~thedac/charm-helpers/lp1537155

« back to all changes in this revision

Viewing changes to charmhelpers/contrib/openstack/context.py

  • Committer: David Ames
  • Date: 2016-01-23 00:22:19 UTC
  • Revision ID: david.ames@canonical.com-20160123002219-nmn1kfspij6ofkgp
Fix Bug#1537155 Use cpu_count() rather than NUM_CPU

Show diffs side-by-side

added added

removed removed

Lines of Context:
1259
1259
    @property
1260
1260
    def num_cpus(self):
1261
1261
        try:
1262
 
            from psutil import NUM_CPUS
 
1262
            from psutil import cpu_count
1263
1263
        except ImportError:
1264
1264
            apt_install('python-psutil', fatal=True)
1265
 
            from psutil import NUM_CPUS
 
1265
            from psutil import cpu_count
1266
1266
 
1267
 
        return NUM_CPUS
 
1267
        return cpu_count()
1268
1268
 
1269
1269
    def __call__(self):
1270
1270
        multiplier = config('worker-multiplier') or 0