You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2018/12/18 06:02:41 UTC
[GitHub] stale[bot] closed pull request #3867: [AIRFLOW-3011][CLI] Add cmd
function printing config
stale[bot] closed pull request #3867: [AIRFLOW-3011][CLI] Add cmd function printing config
URL: https://github.com/apache/incubator-airflow/pull/3867
This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:
As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):
diff --git a/airflow/bin/cli.py b/airflow/bin/cli.py
index 4ff1ae3679..69ebe27794 100644
--- a/airflow/bin/cli.py
+++ b/airflow/bin/cli.py
@@ -1443,6 +1443,19 @@ def sync_perm(args): # noqa
Arg.__new__.__defaults__ = (None, None, None, None, None, None, None)
+@cli_utils.action_logging
+def config(args):
+ """
+ Prints config file contents to STDOUT.
+ :param args:
+ :return:
+ """
+ config_file_path = os.path.join(settings.AIRFLOW_HOME, "airflow.cfg")
+ log.info("Config file location: {}".format(config_file_path))
+ with open(config_file_path, 'r') as config_file:
+ print(config_file.read())
+
+
class CLIFactory(object):
args = {
# Shared
@@ -2040,6 +2053,11 @@ class CLIFactory(object):
'func': sync_perm,
'help': "Update existing role's permissions.",
'args': tuple(),
+ },
+ {
+ 'func': config,
+ 'help': "Displaying config file",
+ 'args': tuple(),
}
)
subparsers_dict = {sp['func'].__name__: sp for sp in subparsers}
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services