Skip to content

Commit a7135c9

Browse files
Zuulopenstack-gerrit
authored andcommitted
Merge "Fix state checking via kolla_set_configs"
2 parents 015fd8d + ea19817 commit a7135c9

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

docker/base/set_configs.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,10 @@ class ConfigFileBadState(ExitingException):
5757
pass
5858

5959

60+
class ConfigFileCommandDiffers(ExitingException):
61+
pass
62+
63+
6064
class ConfigFile(object):
6165

6266
def __init__(self, source, dest, owner=None, perm=None, optional=False,
@@ -414,6 +418,15 @@ def execute_config_strategy(config):
414418
raise InvalidConfig('KOLLA_CONFIG_STRATEGY is not set properly')
415419

416420

421+
def execute_command_check(config):
422+
cmd = config.get('command')
423+
with open("/run_command", "r") as f:
424+
cmd_running = f.read()
425+
if cmd != cmd_running:
426+
msg = "Running command differs. " + cmd + " != " + cmd_running
427+
raise ConfigFileCommandDiffers(msg)
428+
429+
417430
def execute_config_check(config):
418431
for data in config.get('config_files', []):
419432
config_file = ConfigFile(**data)
@@ -431,6 +444,7 @@ def main():
431444
config = load_config()
432445

433446
if args.check:
447+
execute_command_check(config)
434448
execute_config_check(config)
435449
else:
436450
execute_config_strategy(config)
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
fixes:
3+
- |
4+
Fixed an issue where ``kolla_set_configs --check`` failed to detect
5+
changes in the ``command`` block of ``config.json`` file.
6+
`LP#2080861 <https://bugs.launchpad.net/bugs/2080861>`__

0 commit comments

Comments
 (0)