[Zodb-checkins] SVN: ZODB/trunk/src/ Fixed bug: zeopack was less flexible than it was before. -h should

Jim Fulton jim at zope.com
Thu Jul 9 14:26:10 EDT 2009


Log message for revision 101769:
  Fixed bug: zeopack was less flexible than it was before.  -h should
  default to local host.
  

Changed:
  U   ZODB/trunk/src/CHANGES.txt
  U   ZODB/trunk/src/ZEO/scripts/zeopack.py
  U   ZODB/trunk/src/ZEO/scripts/zeopack.test

-=-
Modified: ZODB/trunk/src/CHANGES.txt
===================================================================
--- ZODB/trunk/src/CHANGES.txt	2009-07-09 17:31:14 UTC (rev 101768)
+++ ZODB/trunk/src/CHANGES.txt	2009-07-09 18:26:09 UTC (rev 101769)
@@ -2,7 +2,7 @@
  Change History
 ================
 
-3.9.0b2 (2009-07-??)
+3.9.0b3 (2009-07-??)
 ====================
 
 Bugs Fixed
@@ -14,6 +14,9 @@
 - ZEO protocol 2 support was broken.  This caused very old clients to
   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)
 ====================
 

Modified: ZODB/trunk/src/ZEO/scripts/zeopack.py
===================================================================
--- ZODB/trunk/src/ZEO/scripts/zeopack.py	2009-07-09 17:31:14 UTC (rev 101768)
+++ ZODB/trunk/src/ZEO/scripts/zeopack.py	2009-07-09 18:26:09 UTC (rev 101769)
@@ -104,8 +104,7 @@
                   "specified as well.")
         servers.append(((options.host, options.port), options.name))
     elif options.port:
-        error("If port (-p) is specified then a host (-h) must be "
-              "specified as well.")
+        servers.append(((socket.gethostname(), options.port), options.name))
 
     if options.unix:
         servers.append((options.unix, options.name))

Modified: ZODB/trunk/src/ZEO/scripts/zeopack.test
===================================================================
--- ZODB/trunk/src/ZEO/scripts/zeopack.test	2009-07-09 17:31:14 UTC (rev 101768)
+++ ZODB/trunk/src/ZEO/scripts/zeopack.test	2009-07-09 18:26:09 UTC (rev 101769)
@@ -214,6 +214,16 @@
     pack(384917.0, wait=True)
     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"])
     ClientStorage('foo/bar', read_only=1, storage='2', wait=False)
     is_connected True



More information about the Zodb-checkins mailing list