Commit c02daabd authored by Petr Pudlak's avatar Petr Pudlak
Browse files

Let ConfigWriter delegate DRBD secrets to WConfd

Also WConfd handles proper synchronization internally so there is no
need to explicitly lock the configuration in ConfigWriter.
Signed-off-by: default avatarPetr Pudlak <>
Reviewed-by: default avatarKlaus Aehlig <>
parent cfe1f843
......@@ -286,11 +286,10 @@ class ConfigWriter(object):
self._cfg_file = cfg_file
self._getents = _getents
self._temporary_ids = TemporaryReservationManager()
self._temporary_secrets = TemporaryReservationManager()
self._temporary_lvs = TemporaryReservationManager()
self._temporary_ips = TemporaryReservationManager()
self._all_rms = [self._temporary_ids,
self._temporary_secrets, self._temporary_lvs,
# Note: in order to prevent errors when resolving our name later,
# we compute it here once and reuse it; it's
......@@ -805,16 +804,13 @@ class ConfigWriter(object):
self._temporary_lvs.Reserve(ec_id, lv_name)
def GenerateDRBDSecret(self, ec_id):
def GenerateDRBDSecret(self, _ec_id):
"""Generate a DRBD secret.
This checks the current disks for duplicates.
return self._temporary_secrets.Generate(self._AllDRBDSecrets(),
return self._wconfd.GenerateDRBDSecret(self._GetWConfdContext())
def _AllLVs(self):
"""Compute the list of all LVs.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment