def wopiUnlock(fileid, reqheaders, acctok):
'''Implements the Unlock WOPI call'''
lock = reqheaders['X-WOPI-Lock']
retrievedLock = _retrieveWopiLock(fileid, 'UNLOCK', lock, acctok)
if not _compareWopiLocks(retrievedLock, lock):
return _makeConflictResponse('UNLOCK', retrievedLock, lock, '', acctok['filename'])
# OK, the lock matches. Remove any extended attribute related to locks and conflicts handling
try:
xrdcl.removefile(_getLockName(acctok['filename']), Wopi.lockruid, Wopi.lockrgid, 1)
except IOError:
# ignore, it's not worth to report anything here
pass
try:
xrdcl.rmxattr(acctok['filename'], acctok['ruid'], acctok['rgid'], LASTSAVETIMEKEY)
except IOError:
# same as above
pass
# and update our internal list of opened files
try:
del Wopi.openfiles[acctok['filename']]
except KeyError:
# already removed?
pass
return 'OK', httplib.OK
评论列表
文章目录