summaryrefslogtreecommitdiff
path: root/bin/tools
diff options
context:
space:
mode:
authorChristophe Simonis <christophe@tinyerp.com>2009-01-09 10:15:55 +0100
committerChristophe Simonis <christophe@tinyerp.com>2009-01-09 10:15:55 +0100
commitf4c1cc32bacfce01fbafa1fe47fef925b7d33b4d (patch)
treef76264e5bc48ae034fbc7821541adab3f6683167 /bin/tools
parenteab8eb27cb4f1500463cfd7e4205297212bcc0cf (diff)
[FIX] avoid a crash when the migration server is not accessible
bzr revid: christophe@tinyerp.com-20090109091555-qipdi2hyrxlqpquc
Diffstat (limited to 'bin/tools')
-rw-r--r--bin/tools/maintenance.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/bin/tools/maintenance.py b/bin/tools/maintenance.py
index 959d9f7bf3c..aa3e6b50ad9 100644
--- a/bin/tools/maintenance.py
+++ b/bin/tools/maintenance.py
@@ -22,6 +22,8 @@
import xmlrpclib
+class RemoteContractException(Exception): pass
+
class remote_contract(object):
def __init__(self, contract_id, contract_password, modules=None):
self.__server = 'http://localhost:8069/xmlrpc/'
@@ -30,7 +32,10 @@ class remote_contract(object):
self.__login = "admin"
rpc = xmlrpclib.ServerProxy(self.__server + 'common')
- self.__userid = rpc.login(self.__db, self.__login, self.__password)
+ try:
+ self.__userid = rpc.login(self.__db, self.__login, self.__password)
+ except:
+ raise RemoteContractException("Unable to contact the migration server")
self.__rpc = xmlrpclib.ServerProxy(self.__server + 'object')