Commit 99669c01 authored by Antoine Millet's avatar Antoine Millet
Browse files

Added forward_call to the cli handler

parent e333ea93
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -666,6 +666,17 @@ class CliHandler(RegisteredCCHandler):
                                           'hv_dest': dest['id'],
                                           'author': self.client.login})

    def forward_call(self, login, func, *args, **kwargs):
        """ Forward a call to a connected client and return result.

        :param login: login of the connected client
        :param func: function to execute on the client
        :param \*args, \*\*kwargs: arguments of the call
        """
        self.check('forward_call')
        client = self.server.get_client(login)
        return client.conn.call(func, *args, **kwargs)


class CliClient(Client):