瀏覽代碼

Fix compatibility with Pint 0.5

Conversion from Quantity to int/long was added only in 0.5.2.

Change-Id: I23f93d29a0624b77f4624c6af530971eb6a4c01b
(cherry picked from commit 386654f602)
tags/3.2.4^0
Dmitry Tantsur 8 月之前
父節點
當前提交
71e134a5d3
共有 2 個檔案被更改,包括 6 行新增1 行删除
  1. +1
    -1
      ironic_python_agent/numa_inspector.py
  2. +5
    -0
      releasenotes/notes/pint-0.5-816aaf3a4f6d4a6e.yaml

+ 1
- 1
ironic_python_agent/numa_inspector.py 查看文件

@@ -80,7 +80,7 @@ def get_nodes_memory_info(numa_node_dirs):
# To get memory size with unit from memory info line
# Memory info sample line format 'Node 0 MemTotal: 1560000 kB'
value = line.split(":")[1].strip()
memory_kb = int(UNIT_CONVERTER(value).to_base_units())
memory_kb = int(UNIT_CONVERTER(value).to_base_units().magnitude)
except (ValueError, IndexError, pint.UndefinedUnitError) as exc:
msg = ('Failed to get memory information for %(node)s: '
'%(error)s' % {'node': numa_node_dir, 'error': exc})


+ 5
- 0
releasenotes/notes/pint-0.5-816aaf3a4f6d4a6e.yaml 查看文件

@@ -0,0 +1,5 @@
---
fixes:
- |
Fixes the ``numa-topology`` inspection collector to be compatible with
Pint < 0.5.2.

Loading…
取消
儲存