Commit 14e3a777 authored by Rafael Monnerat's avatar Rafael Monnerat

Launch WCFS, please don't use this code since this is a test only

parent 49fc0de2
......@@ -27,6 +27,8 @@ except KeyError:
activity_node = (zeo_client or neo_storage or 'zeo_server' in os.environ
) and 1 or None
launch_wcfs = int(os.environ.get('launch_wcfs', 0))
data_fs_path = os.environ.get('erp5_tests_data_fs_path',
os.path.join(instance_home, 'var', 'Data.fs'))
load = int(os.environ.get('erp5_load_data_fs', 0))
......@@ -103,6 +105,20 @@ def forkNodes():
cluster = True
def wcfs_serve(zurl):
try:
import time
time.sleep(6)
import wendelin.wcfs
import threading
t = threading.Thread(target=wendelin.wcfs.serve, args=(zurl,"", False))
# Yes, I'm not stopping the thread after, so don't use this code for real
t.start()
except:
raise
_print("Unable to launch wendelin.wcfs.serve!!!")
if neo_storage:
if zeo_client:
sys.exit("--neo_storage conflicts with --zeo_client")
......@@ -146,6 +162,8 @@ else:
save_mysql = None
os.close(zeo_client)
zeo_client = eval(os.fdopen(r).read())
if launch_wcfs:
wcfs_serve("zeo://%s:%s" % zeo_client)
continue
else:
node_pid_list = activity_node = None
......@@ -162,6 +180,7 @@ else:
elif load:
Storage = FileStorage(data_fs_path, read_only=True)
Storage = DemoStorage(base=Storage)
else:
Storage = DemoStorage()
break
......
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