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: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Niklas Hambuechen <niklash@google.com>
Cherry-picked-from:
35056743
Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Hrvoje Ribicic <riba@google.com>
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: