def GetConfig(ec_id, livelock, **kwargs):
  kwargs['wconfdcontext'] = GetWConfdContext(ec_id, livelock)

  # 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)


# job id used for resource management at config upgrade time
A utility function for constructing instances of ConfigWriter.
dataset/ETHPy150Open ganeti/ganeti/lib/config/__init__.py/GetConfig