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