Exemple #1
0
def system_reboot():
    if not check_admin(request_user):
        return jsonify(build_error(ERROR_NOT_AUTHORIZED, "Insufficient privileges for request.")), UNAUTHORIZED

    sh.reboot()
    
    return jsonify(), ACCEPTED
Exemple #2
0
def system_reboot():
    with sh.sudo:
        try:
            sh.sync()
            sh.reboot()
        except sh.ErrorReturnCode_1:
            flash('Unable to reboot device!', 'error')
            return redirect(url_for('settings.host'))

    flash('Rebooting device!', 'success')
    return redirect(url_for('settings.host'))
def system_reboot():
    if not check_admin(request_user):
        return jsonify(build_error(ERROR_NOT_AUTHORIZED, "Insufficient privileges for request.")), UNAUTHORIZED

    try:
        sh.reboot()
    except sh.ErrorReturnCode_1:
        return jsonify(build_error(ERROR_NOT_AUTHORIZED, "System did not respond correctly.")), UNAUTHORIZED
    except sh.ErrorReturnCode_143:
        pass

    return jsonify(), ACCEPTED
 def reboot(self):
     _logger.info("Rebooting...")
     sh.reboot()
 def ui_command_reboot(self):
     """ reboot - reboot system. """
     #status.tasks.reboot.delay()
     print sh.reboot()