Commit 14f0257d authored by Jim Fulton's avatar Jim Fulton

Fixed: server names and multiple servers weren't handled correctly

parent d5082536
...@@ -167,7 +167,8 @@ def main(): ...@@ -167,7 +167,8 @@ def main():
elif opt == '-S': elif opt == '-S':
suicide = False suicide = False
elif opt == '-v': elif opt == '-v':
ZEO.zrpc.connection.Connection.current_protocol = arg.encode('ascii') ZEO.zrpc.connection.Connection.current_protocol = arg.encode(
'ascii')
zo = ZEO.runzeo.ZEOOptions() zo = ZEO.runzeo.ZEOOptions()
zo.realize(["-C", configfile]) zo.realize(["-C", configfile])
...@@ -181,11 +182,11 @@ def main(): ...@@ -181,11 +182,11 @@ def main():
else: else:
test_addr = addr + '-test' test_addr = addr + '-test'
log(label, 'creating the storage server') log(label, 'creating the storage server')
storage = zo.storages[0].open()
mon_addr = None mon_addr = None
if zo.monitor_address: if zo.monitor_address:
mon_addr = zo.monitor_address mon_addr = zo.monitor_address
server = ZEO.runzeo.create_server({"1": storage}, zo) storages = dict((s.name or '1', s.open()) for s in zo.storages)
server = ZEO.runzeo.create_server(storages, zo)
try: try:
log(label, 'creating the test server, keep: %s', keep) log(label, 'creating the test server, keep: %s', keep)
...@@ -194,8 +195,9 @@ def main(): ...@@ -194,8 +195,9 @@ def main():
if e[0] != errno.EADDRINUSE: if e[0] != errno.EADDRINUSE:
raise raise
log(label, 'addr in use, closing and exiting') log(label, 'addr in use, closing and exiting')
storage.close() for storage in storages.values():
cleanup(storage) storage.close()
cleanup(storage)
sys.exit(2) sys.exit(2)
t.register_socket(server.dispatcher) t.register_socket(server.dispatcher)
......
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