Merge "Fix state checking via kolla_set_configs"
This commit is contained in:
commit
a7135c9e15
@ -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)
|
||||
|
6
releasenotes/notes/bug-2080861-a46761ea9e7bbf91.yaml
Normal file
6
releasenotes/notes/bug-2080861-a46761ea9e7bbf91.yaml
Normal file
@ -0,0 +1,6 @@
|
||||
---
|
||||
fixes:
|
||||
- |
|
||||
Fixed an issue where ``kolla_set_configs --check`` failed to detect
|
||||
changes in the ``command`` block of ``config.json`` file.
|
||||
`LP#2080861 <https://bugs.launchpad.net/bugs/2080861>`__
|
Loading…
Reference in New Issue
Block a user