Skip to content
Snippets Groups Projects
Commit 3897c003 authored by Seblu's avatar Seblu
Browse files

catch connecion error

parent 861fbed9
No related branches found
No related tags found
No related merge requests found
...@@ -57,15 +57,19 @@ class Cli(object): ...@@ -57,15 +57,19 @@ class Cli(object):
def _connect(self): def _connect(self):
self.printer.debug("Connecting...") self.printer.debug("Connecting...")
rpcc = SimpleRpcClient.from_addr(self.settings["server"], try:
self.settings["port"], rpcc = SimpleRpcClient.from_addr(self.settings["server"],
enable_ssl=True, self.settings["port"],
default_handler=CliHandler(), enable_ssl=True,
on_disconnect="quit", default_handler=CliHandler(),
timeout=self.settings["timeout"] on_disconnect="quit",
timeout=self.settings["timeout"]
) )
rpcc.start(daemonize=True) rpcc.start(daemonize=True)
self.rpc = ConnectionProxy(rpcc) self.rpc = ConnectionProxy(rpcc)
except Exception:
raise cliError("Connection failure!")
self.printer.debug("Connected.")
def _auth(self): def _auth(self):
'''Handle server authentification''' '''Handle server authentification'''
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment