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

Allow server to terminate properly a cli connect by calling quit method

parent 78745092
No related branches found
No related tags found
No related merge requests found
......@@ -53,15 +53,12 @@ class Cli(object):
self._settings["port"],
enable_ssl=True,
default_handler=CliHandler(),
on_disconnect=self._on_disconnect,
on_disconnect="quit",
timeout=self._settings["timeout"]
)
rpcc.start(daemonize=True)
self.rpc = ConnectionProxy(rpcc)
def _on_disconnect(self, rpc):
printer.fatal("Disconnected from server!")
def _auth(self):
printer.debug("Authenticating...")
if self.rpc.authentify(self._settings["login"], self._settings["pass"]):
......@@ -176,3 +173,8 @@ class CliHandler(RpcHandler):
def get_tags(self, tags=()):
if "version" in tags:
return { "version": cccli.version }
@pure
def quit(self, rpc=None):
printer.fatal("Disconnected from server!")
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