'Process a request to cancel a command\'s execution.
Arguments:
iq -- The command cancellation request.'

def _handle_command_cancel(self, iq):

    node = iq['command']['node']
    sessionid = iq['command']['sessionid']
    session = self.sessions.get(sessionid)
    if session:
        handler = session['cancel']
        if handler:
            handler(iq, session)
        del self.sessions[sessionid]
        iq.reply()
        iq['command']['node'] = node
        iq['command']['sessionid'] = sessionid
        iq['command']['status'] = 'canceled'
        iq['command']['notes'] = session['notes']
        iq.send()
    else:
        raise XMPPError('item-not-found')
