Commit 56d6b5b9 authored by Antoine Millet's avatar Antoine Millet
Browse files

Fixed shutdown on node (old API)

parent 3da7d7f3
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -556,13 +556,12 @@ class CliHandler(RegisteredCCHandler):
                errs.error(obj['id'], 'bad role')
                continue
            try:
                objcon = self.server.get_connection(obj['id'])
                node = self.server.get_client(obj['id'])
            except KeyError:
                errs.error(obj['id'], 'node not connected')
            else:
                try:
                    objcon.connection.call('node_shutdown',
                                                      reboot, gracefull)
                    node.shutdown_node(reboot, gracefull)
                except RpcError as err:
                    errs.error(obj['id'], '%s (exc: %s)' % (err.message,
                                                            err.exception))
+5 −0
Original line number Diff line number Diff line
@@ -13,6 +13,11 @@ class HostClient(Client):
    def execute(self, command):
        return self.conn.call('execute_command', command)

    def shutdown_node(self, reboot=False, gracefull=True):
        """ Shutdown the remote node.
        """
        return self.conn.call('node_shutdown', reboot, gracefull)

    def console(self, name):
        """ Start a remote console on the specified vm.
        """