Commit 6403e83e authored by Jim Fulton's avatar Jim Fulton

Fixed bug: zeopack was less flexible than it was before. -h should

default to local host.
parent a9fdab74
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
Change History Change History
================ ================
3.9.0b2 (2009-07-??) 3.9.0b3 (2009-07-??)
==================== ====================
Bugs Fixed Bugs Fixed
...@@ -14,6 +14,9 @@ Bugs Fixed ...@@ -14,6 +14,9 @@ Bugs Fixed
- ZEO protocol 2 support was broken. This caused very old clients to - ZEO protocol 2 support was broken. This caused very old clients to
be unable to use new servers. be unable to use new servers.
- zeopack was less flexible than it was before. -h should default to
local host.
3.9.0b2 (2009-06-11) 3.9.0b2 (2009-06-11)
==================== ====================
......
...@@ -104,8 +104,7 @@ def _main(args=None, prog=None): ...@@ -104,8 +104,7 @@ def _main(args=None, prog=None):
"specified as well.") "specified as well.")
servers.append(((options.host, options.port), options.name)) servers.append(((options.host, options.port), options.name))
elif options.port: elif options.port:
error("If port (-p) is specified then a host (-h) must be " servers.append(((socket.gethostname(), options.port), options.name))
"specified as well.")
if options.unix: if options.unix:
servers.append((options.unix, options.name)) servers.append((options.unix, options.name))
......
...@@ -214,6 +214,16 @@ Legacy support ...@@ -214,6 +214,16 @@ Legacy support
pack(384917.0, wait=True) pack(384917.0, wait=True)
close() close()
>>> import socket
>>> old_gethostname = socket.gethostname
>>> socket.gethostname = lambda : 'test.host.com'
>>> main(["-d3", "-p", "8100"])
ClientStorage(('test.host.com', 8100), read_only=1, storage='1', wait=False)
is_connected True
pack(384917.0, wait=True)
close()
>>> socket.gethostname = old_gethostname
>>> main(["-d3", "-U", "foo/bar", "-S", "2"]) >>> main(["-d3", "-U", "foo/bar", "-S", "2"])
ClientStorage('foo/bar', read_only=1, storage='2', wait=False) ClientStorage('foo/bar', read_only=1, storage='2', wait=False)
is_connected True is_connected True
......
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