Commit 89546f76 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent eb3a732f
...@@ -34,10 +34,8 @@ from golang.gcompat import qq ...@@ -34,10 +34,8 @@ from golang.gcompat import qq
from ZODB.FileStorage import FileStorage from ZODB.FileStorage import FileStorage
# WCFS represents connection to wcfs server. # Conn represents connection to wcfs server.
# XXX name -> Connection ? class Conn(object):
class WCFS(object):
# XXX + .zurl?
# .mountpoint path to mountpoint # .mountpoint path to mountpoint
# ._fwcfs /.wcfs opened to keep the server from going away (at least cleanly) # ._fwcfs /.wcfs opened to keep the server from going away (at least cleanly)
...@@ -88,7 +86,7 @@ def serve(zurl, exec_=False): ...@@ -88,7 +86,7 @@ def serve(zurl, exec_=False):
# otherwise it starts wcfs for zurl if autostart is True or (None and system # otherwise it starts wcfs for zurl if autostart is True or (None and system
# default for autostart is True). XXX # default for autostart is True). XXX
# #
# join(zurl) -> WCFS. # join(zurl) -> Conn.
def join(zurl, autostart=None): def join(zurl, autostart=None):
mntpt = _mntpt_4zurl(zurl) mntpt = _mntpt_4zurl(zurl)
...@@ -101,7 +99,7 @@ def join(zurl, autostart=None): ...@@ -101,7 +99,7 @@ def join(zurl, autostart=None):
raise raise
else: else:
# already have it # already have it
return WCFS(mntpt, f) return Conn(mntpt, f)
# XXX autostart=None processing # XXX autostart=None processing
if not autostart: if not autostart:
...@@ -111,7 +109,7 @@ def join(zurl, autostart=None): ...@@ -111,7 +109,7 @@ def join(zurl, autostart=None):
# _start starts wcfs server for ZODB @ zurl. # _start starts wcfs server for ZODB @ zurl.
# #
# _start(zurl) -> WCFS # _start(zurl) -> Conn
def _start(zurl): def _start(zurl):
mntpt = _mntpt_4zurl(zurl) mntpt = _mntpt_4zurl(zurl)
log.info("wcfs: starting for %s ...", zurl) log.info("wcfs: starting for %s ...", zurl)
...@@ -205,10 +203,10 @@ def _start(zurl): ...@@ -205,10 +203,10 @@ def _start(zurl):
if _ == 1: if _ == 1:
if isinstance(_rx, file): if isinstance(_rx, file):
# mounted ok - return WCFS object # mounted ok - return Conn object
f = _rx f = _rx
startedok.close() startedok.close()
return WCFS(mntpt, f) return Conn(mntpt, f)
# waitmounted error # waitmounted error
err = _rx err = _rx
......
...@@ -42,11 +42,11 @@ def setup_module(): ...@@ -42,11 +42,11 @@ def setup_module():
def teardown_module(): def teardown_module():
testdb.teardown() testdb.teardown()
# make sure we start every test without wcfs server running # make sure we start every test without wcfs server running.
def setup_function(f): def setup_function(f):
assert not os.path.exists(testmntpt) assert not os.path.exists(testmntpt)
# make sure we unmount wcfs after every test # make sure we unmount wcfs after every test.
def teardown_function(f): def teardown_function(f):
mounted = not subprocess.call(["mountpoint", "-q", testmntpt]) mounted = not subprocess.call(["mountpoint", "-q", testmntpt])
if mounted: if mounted:
......
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