Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
W
wendelin.core
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
Kirill Smelkov
wendelin.core
Commits
d171028b
Commit
d171028b
authored
Oct 12, 2020
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
35392a78
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
3 deletions
+24
-3
lib/tests/test_zodb.py
lib/tests/test_zodb.py
+2
-2
lib/zodb.py
lib/zodb.py
+22
-1
No files found.
lib/tests/test_zodb.py
View file @
d171028b
...
...
@@ -354,8 +354,8 @@ def test_zodb_onresync():
# test that zurl does not change from one open to another storage open.
def
test_zurlstable
():
if
not
isinstance
(
testdb
,
testing
.
TestDB_FileStorage
):
pytest
.
xfail
(
reason
=
"zstor_2zurl is TODO for
ZEO and
NEO"
)
if
not
isinstance
(
testdb
,
(
testing
.
TestDB_FileStorage
,
testing
.
TestDB_ZEO
)
):
pytest
.
xfail
(
reason
=
"zstor_2zurl is TODO for NEO"
)
zurl0
=
None
for
i
in
range
(
10
):
zstor
=
testdb
.
getZODBStorage
()
...
...
lib/zodb.py
View file @
d171028b
...
...
@@ -317,5 +317,26 @@ def zstor_2zurl(zstor):
if
isinstance
(
zstor
,
FileStorage
):
return
"file://%s"
%
(
zstor
.
_file_name
,)
# TODO ZEO + NEO support
ztype
=
type
(
zstor
).
__module__
+
"."
+
type
(
zstor
).
__name__
if
ztype
==
"ZEO.ClientStorage.ClientStorage"
:
u
=
"zeo://"
addr
=
zstor
.
_addr
if
len
(
addr
)
!=
1
:
raise
NotImplementedError
(
"ZEO client has multiple configured servers: %r"
%
(
addr
,))
addr
=
addr
[
0
]
# addr is either TCP (host,port) or UNIX path
if
isinstance
(
addr
,
str
):
u
+=
addr
else
:
host
,
port
=
addr
u
+=
'%s:%d'
%
(
host
,
port
)
storage
=
zstor
.
_storage
if
storage
!=
"1"
:
u
+=
"?storage=%s"
%
storage
# TODO ssl
return
u
# TODO NEO support
raise
NotImplementedError
(
"don't know how to extract zurl from %r"
%
zstor
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment