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/08/09 09:45:23 UTC

[GitHub] ashb commented on a change in pull request #3722: [AIRFLOW-2759] Add changes to extract proxy details at the base hook …

ashb commented on a change in pull request #3722: [AIRFLOW-2759] Add changes to extract proxy details at the base hook …
URL: https://github.com/apache/incubator-airflow/pull/3722#discussion_r208867850
 
 

 ##########
 File path: airflow/hooks/base_hook.py
 ##########
 @@ -88,6 +89,20 @@ def get_hook(cls, conn_id):
         connection = cls.get_connection(conn_id)
         return connection.get_hook()
 
+    def get_proxyconfig(self):
+        log = LoggingMixin().log
+        proxy_config = None
+        try:
+            conf_dict = configuration.as_dict(display_sensitive=False)
+            if conf_dict and 'proxy' in conf_dict:
+                proxy_config = conf_dict['proxy']
+            else:
+                log.error("Proxy section not found in config")
+        except Exception as err:
+            log.error(err)
+            log.error("Got Exception! returning Proxy details as None")
 
 Review comment:
   `log.exceptiion(msg, err)` combines both these lines in one. I think this is over-defensive too - what exception is this catching?

----------------------------------------------------------------
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