[Bugfix] 资产model 太长

pull/968/head
ibuler 2018-01-26 17:17:37 +08:00
parent 9433d6177a
commit 6d4e9c7d30
1 changed files with 1 additions and 0 deletions

View File

@ -55,6 +55,7 @@ def set_assets_hardware_info(result, **kwargs):
break break
else: else:
___cpu_model = 'Unknown' ___cpu_model = 'Unknown'
___cpu_model = ___cpu_model[:64]
___cpu_count = info['ansible_processor_count'] ___cpu_count = info['ansible_processor_count']
___cpu_cores = info.get('ansible_processor_cores', None) or len(info.get('ansible_processor', [])) ___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'])) ___memory = '%s %s' % capacity_convert('{} MB'.format(info['ansible_memtotal_mb']))