Skip to content

Commit

Permalink
Adding an endpoint to get the raw config, will be used to automate se…
Browse files Browse the repository at this point in the history
…tting up a sandbox
  • Loading branch information
mistercrunch committed Mar 1, 2015
1 parent ed207f0 commit 28a0153
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 10 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ Airflow
====
Airflow is a system to programmaticaly author, schedule and monitor data pipelines.

[Documentation](http://airflow.readthedocs.org/en/latest/)
[Documentation](http://pythonhosted.org/airflow/)
26 changes: 17 additions & 9 deletions airflow/www/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -554,20 +554,28 @@ def circles(self):
@login_required
def conf(self):
from airflow import configuration
raw = request.args.get('raw') == "true"
title = "Airflow Configuration"
subtitle = configuration.AIRFLOW_CONFIG
f = open(configuration.AIRFLOW_CONFIG, 'r')
config = f.read()

code_html = Markup(highlight(
f.read(),
IniLexer(), # Lexer call
HtmlFormatter(noclasses=True))
)
f.close()
return self.render(
'airflow/code.html',
pre_subtitle=settings.HEADER + " v" + airflow.__version__,
code_html=code_html, title=title, subtitle=subtitle)
if raw:
return Response(
response=config,
status=200,
mimetype="application/text")
else:
code_html = Markup(highlight(
config,
IniLexer(), # Lexer call
HtmlFormatter(noclasses=True))
)
return self.render(
'airflow/code.html',
pre_subtitle=settings.HEADER + " v" + airflow.__version__,
code_html=code_html, title=title, subtitle=subtitle)

@expose('/noaccess')
def noaccess(self):
Expand Down

0 comments on commit 28a0153

Please sign in to comment.