From 8fb54da2f91a88286fcc1b444d26b387cd04d174 Mon Sep 17 00:00:00 2001 From: Kirill Zaitsev Date: Fri, 1 Jul 2016 18:20:38 +0300 Subject: [PATCH] Use multiprocessing.cpu_count instead of psutil.NUM_CPUS psutil.NUM_CPUS has been deprecated in psutil 2.x While currently global-requirements restrict usage of psutil to versions <2.0.0 it can be good to be prepared for upgrade in advance. This commit makes use of multiprocessing module instead. Change-Id: I6a4653eb7e5c26c3068a4d766acb4bc219920f75 Closes-Bug: #1598208 --- murano/common/statservice.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/murano/common/statservice.py b/murano/common/statservice.py index fc2141dd6..f2cbdf973 100644 --- a/murano/common/statservice.py +++ b/murano/common/statservice.py @@ -14,6 +14,7 @@ import json +import multiprocessing import socket import time @@ -72,7 +73,7 @@ class StatsCollectingService(service.Service): v1.stats.error_count, v1.stats.average_time, v1.stats.requests_per_tenant, - psutil.NUM_CPUS, + multiprocessing.cpu_count(), psutil.cpu_percent()) return