Conditions | 3 |
Total Lines | 14 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | # -*- coding: utf-8 -*- |
||
7 | def ejabberd_testserver_is_up(url): |
||
8 | proxy = ServerProxy(url) |
||
9 | |||
10 | try: |
||
11 | proxy._() # Call a fictive method. |
||
12 | except socket.error: |
||
13 | # Not connected ; socket error mean that the service is unreachable. |
||
14 | return False |
||
15 | except BaseException: |
||
16 | # connected to the server and the method doesn't exist which is expected. |
||
17 | pass |
||
18 | |||
19 | # Just in case the method is registered in the XmlRPC server |
||
20 | return True |
||
21 |