Commit bb40185b authored by Kirill Smelkov's avatar Kirill Smelkov

X wcfs: Take $WENDELIN_CORE_WCFS_OPTIONS into account not only from under join

This way when wcfs is started via _start it also takes default options
into account. Noticid while running test_join with
$WENDELIN_CORE_WCFS_OPTIONS set and not propagated to spawned wcfs.
parent 2792d7df
......@@ -58,7 +58,7 @@ The following environment variables can be used to control wcfs.py client:
no join: don't spawn wcfs server unless explicitly requested via autostart=True
$WENDELIN_CORE_WCFS_OPTIONS
"" join: additional options to pass to wcfs server if one is spawned
"" additional options to pass to wcfs server when spawned it
"""
from __future__ import print_function, absolute_import
......@@ -207,8 +207,7 @@ def join(zurl, autostart=_default_autostart()): # -> WCFS
# start wcfs with telling it to automatically exit when there is no client activity.
# XXX race window if external process starts after ^^^ check
# TODO -> fs-level locking
optv_extra = os.environ.get("WENDELIN_CORE_WCFS_OPTIONS", "").split()
return _start(zurl, "-autoexit", *optv_extra)
return _start(zurl, "-autoexit")
# _start starts wcfs server for ZODB @ zurl.
......@@ -219,6 +218,9 @@ def _start(zurl, *optv): # -> WCFS
mntpt = _mntpt_4zurl(zurl)
log.info("wcfs: starting for %s ...", zurl)
optv_defaults = os.environ.get("WENDELIN_CORE_WCFS_OPTIONS", "").split()
optv = tuple(optv_defaults) + optv
# XXX errctx "wcfs: start"
# spawn wcfs and wait till filesystem-level access to it is ready
......@@ -341,6 +343,8 @@ def _mkdir_p(path, mode=0777): # -> created(bool)
def serve(zurl, optv, exec_=False):
mntpt = _mntpt_4zurl(zurl)
# XXX take $WENDELIN_CORE_WCFS_OPTIONS into account?
# try opening .wcfs - it is an error if we can do it.
# XXX -> option to wcfs itself to verify wcfs/something is already mounted?
try:
......
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