From 723805d395a904d8171a4fdff1f8d93450b01cf8 Mon Sep 17 00:00:00 2001 From: ibuler Date: Fri, 26 Jan 2018 16:28:40 +0800 Subject: [PATCH] =?UTF-8?q?[Bugfix]=20=E4=BF=AE=E5=A4=8Dbsd=E8=8E=B7?= =?UTF-8?q?=E5=8F=96cpu=E6=95=B0=E9=87=8Fbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/assets/tasks.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/assets/tasks.py b/apps/assets/tasks.py index dc4a3b2fa..4ba59298e 100644 --- a/apps/assets/tasks.py +++ b/apps/assets/tasks.py @@ -56,7 +56,7 @@ def set_assets_hardware_info(result, **kwargs): else: ___cpu_model = 'Unknown' ___cpu_count = info['ansible_processor_count'] - ___cpu_cores = info.get('ansible_processor_cores', '') + ___cpu_cores = info.get('ansible_processor_cores', None) or len(info.get('ansible_processor', [])) ___memory = '%s %s' % capacity_convert('{} MB'.format(info['ansible_memtotal_mb'])) disk_info = {} for dev, dev_info in info['ansible_devices'].items():