Repository: incubator-airflow
Updated Branches:
  refs/heads/master d8c0a1fc5 -> aedf8de61


[AIRFLOW-1639] Fix Fernet error handling

When the encrypted string cannot be decryted using
Fernet for some
reason, an error will be thrown. In Python 3.6.2
the .message attr
is not available. By casting the ValueError to a
string, the message
will be extracted from the Error.

Closes #2629 from Fokko/AIRFLOW-1639-fix-error-
handling


Project: http://git-wip-us.apache.org/repos/asf/incubator-airflow/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-airflow/commit/aedf8de6
Tree: http://git-wip-us.apache.org/repos/asf/incubator-airflow/tree/aedf8de6
Diff: http://git-wip-us.apache.org/repos/asf/incubator-airflow/diff/aedf8de6

Branch: refs/heads/master
Commit: aedf8de61e21157ec671f9ed6ff511ee8898544f
Parents: d8c0a1f
Author: Fokko Driesprong <[email protected]>
Authored: Sun Sep 24 21:36:04 2017 +0200
Committer: Bolke de Bruin <[email protected]>
Committed: Sun Sep 24 21:36:04 2017 +0200

----------------------------------------------------------------------
 airflow/models.py | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-airflow/blob/aedf8de6/airflow/models.py
----------------------------------------------------------------------
diff --git a/airflow/models.py b/airflow/models.py
index 0b7a3b0..26ea798 100755
--- a/airflow/models.py
+++ b/airflow/models.py
@@ -101,8 +101,7 @@ def get_fernet():
     try:
         return Fernet(configuration.get('core', 'FERNET_KEY').encode('utf-8'))
     except ValueError as ve:
-        raise AirflowException("Could not create Fernet object: {}"
-                               .format(ve.message))
+        raise AirflowException("Could not create Fernet object: {}".format(ve))
 
 
 if 'mysql' in settings.SQL_ALCHEMY_CONN:

Reply via email to