summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitry Tantsur <dtantsur@protonmail.com>2019-09-25 11:47:23 +0200
committerDmitry Tantsur <dtantsur@protonmail.com>2019-09-25 19:02:43 +0000
commit71e134a5d352722a77c27924c91591609a60b645 (patch)
tree36b4c27d90f7a7ed9ced4945ae53f46793732f9e
parent0bb161398ad6f5b4fe2b07876e5bcad190452b99 (diff)
downloadironic-python-agent-queens-em.tar.gz
Fix compatibility with Pint 0.5queens-em3.2.4
Conversion from Quantity to int/long was added only in 0.5.2. Change-Id: I23f93d29a0624b77f4624c6af530971eb6a4c01b (cherry picked from commit 386654f602c86495515811dd741652a3b0292fd3)
-rw-r--r--ironic_python_agent/numa_inspector.py2
-rw-r--r--releasenotes/notes/pint-0.5-816aaf3a4f6d4a6e.yaml5
2 files changed, 6 insertions, 1 deletions
diff --git a/ironic_python_agent/numa_inspector.py b/ironic_python_agent/numa_inspector.py
index f952ba30..c7d35cc5 100644
--- a/ironic_python_agent/numa_inspector.py
+++ b/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})
diff --git a/releasenotes/notes/pint-0.5-816aaf3a4f6d4a6e.yaml b/releasenotes/notes/pint-0.5-816aaf3a4f6d4a6e.yaml
new file mode 100644
index 00000000..3b6cd262
--- /dev/null
+++ b/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.