-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
383 additions
and
216 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
''' | ||
commoniface.py | ||
common entities used by all storage interfaces for the IOP WOPI server | ||
Author: Giuseppe.LoPresti@cern.ch, CERN/IT-ST | ||
''' | ||
|
||
import time | ||
import json | ||
|
||
# standard file missing message | ||
ENOENT_MSG = 'No such file or directory' | ||
|
||
# standard error thrown when attempting to overwrite a file/xattr in O_EXCL mode | ||
EXCL_ERROR = 'File exists and islock flag requested' | ||
|
||
# standard error thrown when attempting an operation without the required access rights | ||
ACCESS_ERROR = 'Operation not permitted' | ||
|
||
# name of the xattr storing the Reva lock | ||
LOCKKEY = 'user.iop.lock' | ||
|
||
def genrevalock(appname, value): | ||
'''Return a JSON-formatted lock compatible with the Reva implementation of the CS3 Lock API''' | ||
return json.dumps({'h': appname if appname else 'wopi', 't': int(time.time()), 'md': value}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.