def TryUpdateLocks(self, _cid, req):
    # Note that UpdateLocksWaiting in this mock
    # relies on TryUpdateLocks to always succeed.
    for lockrq in req:
      if lockrq[1] == "release":
        if lockrq[0] in self.wconfdmock.mylocks:
          del self.wconfdmock.mylocks[lockrq[0]]
      else:
        self.wconfdmock.mylocks[lockrq[0]] = lockrq[1]
        self.wconfdmock.all_locks[lockrq[0]] = lockrq[1]
    return []
dataset/ETHPy150Open ganeti/ganeti/test/py/cmdlib/testsupport/wconfd_mock.py/MockClient.TryUpdateLocks/original