summaryrefslogtreecommitdiff
path: root/docker
diff options
context:
space:
mode:
authorZuul <zuul@review.opendev.org>2020-09-17 14:29:23 +0000
committerGerrit Code Review <review@openstack.org>2020-09-17 14:29:23 +0000
commit6beff0cfc92f3df0ff7210d8388506a1f961a5c3 (patch)
treec3a79a4e9415a884a95f3e50c8c3a2784cafe594 /docker
parent08a3d4fd1ac98fb50a59246ce90dea55007fea1b (diff)
parent797ecd6ddbadcc7a726ce1611c210667565d8a91 (diff)
downloadkolla-6beff0cfc92f3df0ff7210d8388506a1f961a5c3.tar.gz
kolla-6beff0cfc92f3df0ff7210d8388506a1f961a5c3.zip
Merge "Fix kolla_set_configs --check with a directory" into stable/train
Diffstat (limited to 'docker')
-rw-r--r--docker/base/set_configs.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/docker/base/set_configs.py b/docker/base/set_configs.py
index 9176a510d..dea1ac139 100644
--- a/docker/base/set_configs.py
+++ b/docker/base/set_configs.py
@@ -196,8 +196,8 @@ class ConfigFile(object):
return False
for file_ in files:
full_path = os.path.join(root, file_)
- dest_full_path = os.path.join(dest, os.path.relpath(source,
- full_path))
+ dest_full_path = os.path.join(dest, os.path.relpath(full_path,
+ source))
if not self._cmp_file(full_path, dest_full_path):
return False
return True
@@ -217,8 +217,9 @@ class ConfigFile(object):
# otherwise means copy the source to dest
if dest.endswith(os.sep):
dest = os.path.join(dest, os.path.basename(source))
- if os.path.isdir(source) and not self._cmp_dir(source, dest):
- bad_state_files.append(source)
+ if os.path.isdir(source):
+ if not self._cmp_dir(source, dest):
+ bad_state_files.append(source)
elif not self._cmp_file(source, dest):
bad_state_files.append(source)
if len(bad_state_files) != 0:
@@ -396,7 +397,7 @@ def execute_config_strategy(config):
def execute_config_check(config):
- for data in config['config_files']:
+ for data in config.get('config_files', []):
config_file = ConfigFile(**data)
config_file.check()