You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2018/12/18 06:03:00 UTC

[jira] [Commented] (AIRFLOW-3011) CLI command to output actual airflow.cfg

    [ https://issues.apache.org/jira/browse/AIRFLOW-3011?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16723735#comment-16723735 ] 

ASF GitHub Bot commented on AIRFLOW-3011:
-----------------------------------------

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


> CLI command to output actual airflow.cfg
> ----------------------------------------
>
>                 Key: AIRFLOW-3011
>                 URL: https://issues.apache.org/jira/browse/AIRFLOW-3011
>             Project: Apache Airflow
>          Issue Type: New Feature
>          Components: cli
>    Affects Versions: 1.10.0
>            Reporter: Victor
>            Assignee: Valerii Zhuk
>            Priority: Minor
>
> The only way to see the actual airflow configuration (including overriden informations with environment variables) is through web ui.
> For security reason, this is often disabled.
> A CLI command to do the same thing would:
>  * give admins a way to see it
>  * give operators a way to manipulate the configuration (storing it, etc)



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)