From cbe822898b6cf2d31e0d96e837fee58fe209bc2c Mon Sep 17 00:00:00 2001 From: Petr Pudlak Date: Tue, 20 May 2014 10:39:29 +0200 Subject: [PATCH] Flush the configuration before cluster verify For this expose the flushing operation in Python ConfigWriter. Signed-off-by: Petr Pudlak Reviewed-by: Klaus Aehlig --- lib/cmdlib/cluster.py | 3 +++ lib/config.py | 10 ++++++++++ 2 files changed, 13 insertions(+) diff --git a/lib/cmdlib/cluster.py b/lib/cmdlib/cluster.py index 14d8621a4..6e94ca17c 100644 --- a/lib/cmdlib/cluster.py +++ b/lib/cmdlib/cluster.py @@ -1866,6 +1866,9 @@ class LUClusterVerifyConfig(NoHooksLU, _VerifyErrors): self.bad = False self._feedback_fn = feedback_fn + # Force the configuration to be fully distributed before doing any tests + self.cfg.FlushConfig() + feedback_fn("* Verifying cluster config") for msg in self.cfg.VerifyConfig(): diff --git a/lib/config.py b/lib/config.py index fe234fbfc..83d587e40 100644 --- a/lib/config.py +++ b/lib/config.py @@ -3470,3 +3470,13 @@ class ConfigWriter(object): " in the candidate map." % node_uuid) return del cluster.candidate_certs[node_uuid] + + def FlushConfig(self): + """Force the distribution of configuration to master candidates. + + It is not necessary to hold a lock for this operation, it is handled + internally by WConfd. + + """ + if not self._offline: + self._wconfd.FlushConfig() -- GitLab