If the configuration client is opened in the 'accept_foreign' mode,
meaning it is running on a non-master node temporarily, the option
needs to be propagated to the RPC client as well.

This fixes issue #1115.

Signed-off-by: Petr Pudlak <[email protected]>
---
 lib/config.py | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/lib/config.py b/lib/config.py
index fc5a11a..fbd953f 100644
--- a/lib/config.py
+++ b/lib/config.py
@@ -102,7 +102,12 @@ def GetConfig(ec_id, livelock, **kwargs):
 
   """
   kwargs['wconfdcontext'] = GetWConfdContext(ec_id, livelock)
-  kwargs['wconfd'] = wc.Client()
+
+  # if the config is to be opened in the accept_foreign mode, we should
+  # also tell the RPC client not to check for the master node
+  accept_foreign = kwargs.get('accept_foreign', False)
+  kwargs['wconfd'] = wc.Client(allow_non_master=accept_foreign)
+
   return ConfigWriter(**kwargs)
 
 
-- 
2.4.3.573.g4eafbef

Reply via email to