Commit a88a245e authored by Klaus Aehlig's avatar Klaus Aehlig

Only unlock config if we did lock it

We only acquired a config lock if it was not shared in order
to have lock-free reads. Hence, only release the config lock
if we actually acquired it.
Signed-off-by: default avatarKlaus Aehlig <aehlig@google.com>
Reviewed-by: default avatarNiklas Hambuechen <niklash@google.com>

Cherry-picked-from: 35056743Signed-off-by: default avatarKlaus Aehlig <aehlig@google.com>
Reviewed-by: default avatarHrvoje Ribicic <riba@google.com>
parent c561a8f0
......@@ -2844,7 +2844,7 @@ class ConfigWriter(object):
logging.critical("Can't write the configuration: %s", str(err))
raise
finally:
if not self._offline:
if not self._offline and not self._lock_current_shared:
try:
self._wconfd.UnlockConfig(self._GetWConfdContext())
except AttributeError:
......
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