Commit 22ff6379 authored by Jérome Perrin's avatar Jérome Perrin

utils: new _getPortFromPath ( XXX wrong name )

parent 9e13ddf3
......@@ -39,6 +39,16 @@ from erp5.util.testnode.SlapOSControler import SlapOSControler
from erp5.util.testnode.ProcessManager import ProcessManager
from ..slap.standalone import StandaloneSlapOS
from ..slap.standalone import SlapOSNodeCommandError
def _getPortFromPath(path):
"""A stable port using a hash from path.
"""
import hashlib
return (int(hashlib.md5(path).hexdigest(), 16) + 1024) \
% (65535 - 1024)
# TODO:
# - allow requesting multiple instances ?
......
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