summaryrefslogtreecommitdiff
path: root/docker
diff options
context:
space:
mode:
authorDawud M <dawud@stackhpc.com>2023-02-15 18:02:05 +0000
committerMichal Nasiadka <mnasiadka@gmail.com>2023-08-30 07:13:58 +0000
commit3684f67fee9026ff85771517af32f12d48e9c625 (patch)
tree7cc405538a60cfbcf795f56790f04c4e88702786 /docker
parent9b612fa231acf239926e4790165d6ae16074f99e (diff)
downloadkolla-3684f67fee9026ff85771517af32f12d48e9c625.tar.gz
kolla-3684f67fee9026ff85771517af32f12d48e9c625.zip
Add comprehensive checks for container restarts
When adding a dashboard to grafana the containers aren't restarted when they should be. This is due to a bug in Kolla where the logic to determine whether or the container needs to be restarted fails in the case where the file does not exist in the container. This patch adds more comprehensive checks for container restarts in the set_configs.py file. This patch also adds a test to ensure that the functions work as expected. Closes-Bug: #1997984 Co-Authored-By: Will Szumski <will@stackhpc.com> Change-Id: I67f5f12700d7b55f26bff81e9b54559303da6d83 (cherry picked from commit d9a6c5f3901e078a30d341397ac57d867d8191cc)
Diffstat (limited to 'docker')
-rw-r--r--docker/base/set_configs.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/docker/base/set_configs.py b/docker/base/set_configs.py
index 559f1c0f3..40c3e5162 100644
--- a/docker/base/set_configs.py
+++ b/docker/base/set_configs.py
@@ -162,9 +162,11 @@ class ConfigFile(object):
def _cmp_file(self, source, dest):
# check exsit
if (os.path.exists(source) and
- not self.optional and
not os.path.exists(dest)):
return False
+ if (os.path.exists(dest) and
+ not os.path.exists(source)):
+ return False
# check content
with open(source, 'rb') as f1, open(dest, 'rb') as f2:
if f1.read() != f2.read():