List-RPC reads its host:port in configuration file.
authorFlorent Bruneau <florent.bruneau@polytechnique.org>
Sun, 31 Aug 2008 16:39:30 +0000 (18:39 +0200)
committerFlorent Bruneau <florent.bruneau@polytechnique.org>
Sun, 31 Aug 2008 16:39:30 +0000 (18:39 +0200)
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
bin/lists.rpc.py
configs/platal.ini

index 3540e48..8484af0 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 #***************************************************************************
-#*  Copyright (C) 2004 polytechnique.org                                   *
+#*  Copyright (C) 2004-2008 polytechnique.org                              *
 #*  http://opensource.polytechnique.org/                                   *
 #*                                                                         *
 #*  This program is free software; you can redistribute it and/or modify   *
@@ -74,6 +74,9 @@ PLATAL_DOMAIN2 = get_config('Mail', 'domain2', '')
 VHOST_SEP      = get_config('Lists', 'vhost_sep', '_')
 ON_CREATE_CMD  = get_config('Lists', 'on_create', '')
 
+SRV_HOST       = get_config('Lists', 'rpchost', 'localhost')
+SRV_PORT       = int(get_config('Lists', 'rpcport', '4949'))
+
 ################################################################################
 #
 # CLASSES
@@ -968,7 +971,7 @@ lock = Lock()
 #-------------------------------------------------------------------------------
 # server
 #
-server = FastXMLRPCServer(("localhost", 4949), BasicAuthXMLRPCRequestHandler)
+server = FastXMLRPCServer((SRV_HOST, SRV_PORT), BasicAuthXMLRPCRequestHandler)
 
 # index.php
 server.register_function(get_lists)
index 3923847..7580684 100644 (file)
@@ -28,7 +28,7 @@ webservice_url = ""
 
 [Lists]
 rpchost   = "localhost"
-rpcport   = 4949
+rpcport   = "4949"
 
 spool     = "/var/lib/mailman/archives/private"
 vhost_sep = "_"