

@expose('/plugin-setup/<rlms_id>/', methods=['GET', 'POST'])
def plugin_setup(self, rlms_id):
    rlms_obj = self.session.query(RLMS).filter_by(id=rlms_id).first()
    if (not rlms_obj):
        return ('RLMS not found', 404)
    if (rlms_obj.kind != http_plugin.PLUGIN_NAME):
        return ('RLMS is not HTTP', 400)
    ManagerClass = get_manager_class(rlms_obj.kind, rlms_obj.version, rlms_obj.id)
    rlms_instance = ManagerClass(rlms_obj.configuration)
    back_url = url_for('.edit_view', id=rlms_id, _external=True)
    try:
        setup_url = rlms_instance.setup(back_url=back_url)
    except Exception as e:
        flash(gettext(("Couldn't load the setup URL! (this usually means that the plug-in is not correctly configured). Error message: %s" % e)))
        return redirect(back_url)
    else:
        return redirect(setup_url)

dataset/ETHPy150Open gateway4labs/labmanager/labmanager/views/admin.py RLMSPanel.plugin_setup/original