diff options
| author | Dawud M <dawud@stackhpc.com> | 2023-02-15 18:02:05 +0000 |
|---|---|---|
| committer | Dawud M <dawud@stackhpc.com> | 2023-03-09 18:03:58 +0000 |
| commit | d9a6c5f3901e078a30d341397ac57d867d8191cc (patch) | |
| tree | 61495fe4dac62fb360bc00807a0ab1154ca3c921 /docker/base | |
| parent | c1cea309a42034e32a18840201383f77e7da31e2 (diff) | |
| download | kolla-d9a6c5f3901e078a30d341397ac57d867d8191cc.tar.gz kolla-d9a6c5f3901e078a30d341397ac57d867d8191cc.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
Diffstat (limited to 'docker/base')
| -rw-r--r-- | docker/base/set_configs.py | 4 |
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(): |
