[
https://issues.apache.org/jira/browse/AIRFLOW-652?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15693821#comment-15693821
]
Siddharth Anand commented on AIRFLOW-652:
-----------------------------------------
Git blame shows that [~bolke] added in a year ago. Not sure what he intended.
d12dc188 (Bolke de Bruin 2015-10-24 23:21:44 +0200 627)
@expose('/sandbox')
d12dc188 (Bolke de Bruin 2015-10-24 23:21:44 +0200 628)
@login_required
d12dc188 (Bolke de Bruin 2015-10-24 23:21:44 +0200 629) def
sandbox(self):
d12dc188 (Bolke de Bruin 2015-10-24 23:21:44 +0200 630) title =
"Sandbox Suggested Configuration"
b5ed58c1 (Maxime Beauchemin 2016-02-03 10:23:55 -0800 631) cfg_loc
= conf.AIRFLOW_CONFIG + '.sandbox'
d12dc188 (Bolke de Bruin 2015-10-24 23:21:44 +0200 632) f =
open(cfg_loc, 'r')
d12dc188 (Bolke de Bruin 2015-10-24 23:21:44 +0200 633) config =
f.read()
d12dc188 (Bolke de Bruin 2015-10-24 23:21:44 +0200 634) f.close()
d12dc188 (Bolke de Bruin 2015-10-24 23:21:44 +0200 635)
code_html = Markup(highlight(
d12dc188 (Bolke de Bruin 2015-10-24 23:21:44 +0200 636)
config,
d12dc188 (Bolke de Bruin 2015-10-24 23:21:44 +0200 637)
lexers.IniLexer(), # Lexer call
d12dc188 (Bolke de Bruin 2015-10-24 23:21:44 +0200 638)
HtmlFormatter(noclasses=True))
d12dc188 (Bolke de Bruin 2015-10-24 23:21:44 +0200 639) )
d12dc188 (Bolke de Bruin 2015-10-24 23:21:44 +0200 640) return
self.render(
d12dc188 (Bolke de Bruin 2015-10-24 23:21:44 +0200 641)
'airflow/code.html',
d12dc188 (Bolke de Bruin 2015-10-24 23:21:44 +0200 642)
code_html=code_html, title=title, subtitle=cfg_loc)
His actual commit looks like removed the sandbox endpoint :
https://github.com/apache/incubator-airflow/commit/d12dc188
Go ahead and file a PR to remove it unless [~bolke] says otherwise.
> Endpoint /admin/airflow/sandbox seems unnecessary
> -------------------------------------------------
>
> Key: AIRFLOW-652
> URL: https://issues.apache.org/jira/browse/AIRFLOW-652
> Project: Apache Airflow
> Issue Type: Improvement
> Components: webserver
> Reporter: Kengo Seki
> Priority: Minor
>
> airflow/www/views.py exposes an endpoint /sandbox as follows:
> {code}
> 627 @expose('/sandbox')
> 628 @login_required
> 629 def sandbox(self):
> 630 title = "Sandbox Suggested Configuration"
> 631 cfg_loc = conf.AIRFLOW_CONFIG + '.sandbox'
> 632 f = open(cfg_loc, 'r')
> 633 config = f.read()
> 634 f.close()
> 635 code_html = Markup(highlight(
> 636 config,
> 637 lexers.IniLexer(), # Lexer call
> 638 HtmlFormatter(noclasses=True))
> 639 )
> 640 return self.render(
> 641 'airflow/code.html',
> 642 code_html=code_html, title=title, subtitle=cfg_loc)
> {code}
> But this endpoint seems unused. If there is no airflow.cfg.sandbox file,
> "Ooops" page is shown. I think we can remove this for code cleanup.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)