Commit 40535698 authored by Seblu's avatar Seblu
Browse files

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

parent 78745092
Loading
Loading
Loading
Loading
+6 −4
Original line number Diff line number Diff line
@@ -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!")