aboutsummaryrefslogtreecommitdiff
path: root/ansible/module_utils
diff options
context:
space:
mode:
authorLoan Harrouin <loan.harrouin@gmail.com>2026-05-05 15:58:39 +0200
committerLoan Harrouin <loan.harrouin@gmail.com>2026-08-04 17:10:00 +0000
commit0d656aa1e1fcc04ea2ffab5068aa934784c88f64 (patch)
treef3ac8a119df3126b4024fa402971e135309ffc58 /ansible/module_utils
parentdcd07540af662e1283ca77ab5d3b92996f4f992d (diff)
downloadkolla-ansible-0d656aa1e1fcc04ea2ffab5068aa934784c88f64.tar.gz
kolla-ansible-0d656aa1e1fcc04ea2ffab5068aa934784c88f64.zip
Fix Docker cpuset dimension comparison
When enabling cpuset_cpus or cpuset_mems on existing Docker containers, Docker may report the current value as an empty string when no cpuset constraint is configured. These dimensions are cpuset-list strings, not numeric resource values. Compare them as strings in the Docker worker instead of passing them through the numeric dimension comparison logic. Closes-Bug: 2143874 Change-Id: I1b8cd72846b28f556c8f9a0ba114a8af9221e85a Signed-off-by: Loan Harrouin <loan.harrouin@gmail.com> (cherry picked from commit 8304bb3884237bf5aee1c60715d097e88561d56d)
Diffstat (limited to 'ansible/module_utils')
-rw-r--r--ansible/module_utils/kolla_docker_worker.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/ansible/module_utils/kolla_docker_worker.py b/ansible/module_utils/kolla_docker_worker.py
index 232ec5ba1..70b6af39b 100644
--- a/ansible/module_utils/kolla_docker_worker.py
+++ b/ansible/module_utils/kolla_docker_worker.py
@@ -184,6 +184,14 @@ class DockerWorker(ContainerWorker):
'ExitCode: %s Message: %s' %
(exec_inspect['ExitCode'], output))
+ def dimensions_differ(self, a, b, key):
+ if key in ('cpuset_cpus', 'cpuset_mems'):
+ a = str(a or '')
+ b = str(b or '')
+ return a != b
+
+ return super().dimensions_differ(a, b, key)
+
def get_image_id(self):
full_image = self.params.get('image')