diff options
| author | Zuul <zuul@review.opendev.org> | 2024-09-20 08:36:34 +0000 |
|---|---|---|
| committer | Gerrit Code Review <review@openstack.org> | 2024-09-20 08:36:34 +0000 |
| commit | a7135c9e15b4ec919f971afa0821752c692d6247 (patch) | |
| tree | 164c713c93001a13b6186a6c5f9271b72f326eeb /docker | |
| parent | 015fd8d42a42a49243970c703fd513d3d5b2ce74 (diff) | |
| parent | ea198170bacf5735eaca22306011a24c1ea65532 (diff) | |
| download | kolla-a7135c9e15b4ec919f971afa0821752c692d6247.tar.gz kolla-a7135c9e15b4ec919f971afa0821752c692d6247.zip | |
Merge "Fix state checking via kolla_set_configs"
Diffstat (limited to 'docker')
| -rw-r--r-- | docker/base/set_configs.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/docker/base/set_configs.py b/docker/base/set_configs.py index 640e3e2d2..82e2e4589 100644 --- a/docker/base/set_configs.py +++ b/docker/base/set_configs.py @@ -57,6 +57,10 @@ class ConfigFileBadState(ExitingException): pass +class ConfigFileCommandDiffers(ExitingException): + pass + + class ConfigFile(object): def __init__(self, source, dest, owner=None, perm=None, optional=False, @@ -414,6 +418,15 @@ def execute_config_strategy(config): raise InvalidConfig('KOLLA_CONFIG_STRATEGY is not set properly') +def execute_command_check(config): + cmd = config.get('command') + with open("/run_command", "r") as f: + cmd_running = f.read() + if cmd != cmd_running: + msg = "Running command differs. " + cmd + " != " + cmd_running + raise ConfigFileCommandDiffers(msg) + + def execute_config_check(config): for data in config.get('config_files', []): config_file = ConfigFile(**data) @@ -431,6 +444,7 @@ def main(): config = load_config() if args.check: + execute_command_check(config) execute_config_check(config) else: execute_config_strategy(config) |
