

def _handle_shutdown_command(self, iq, session):

    def handle_shutdown(form, session):
        log.debug('Remote shutdown request received. Disconnecting in 3 seconds.')
        self.xmpp.schedule('Shutdown Request', 3, self.xmpp.disconnect)
    if self.whitelist:
        if (iq['from'].bare not in self.whitelist):
            raise XMPPError('not-authorized', etype='cancel')
    form = self.xmpp['xep_0004'].makeForm(ftype='form')
    form['title'] = 'Remote Shutdown'
    form['instructions'] = 'Confirm Shutdown'
    session['payload'] = form
    session['next'] = handle_shutdown
    session['has_next'] = False
    return session

dataset/ETHPy150Open legastero/Kestrel/kestrel/plugins/kestrel_shutdown.py kestrel_shutdown._handle_shutdown_command/original