Repository: incubator-airflow Updated Branches: refs/heads/v1-9-test 9ba73d75f -> 87df670a4
[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 (cherry picked from commit aedf8de61e21157ec671f9ed6ff511ee8898544f) Signed-off-by: Bolke de Bruin <[email protected]> Project: http://git-wip-us.apache.org/repos/asf/incubator-airflow/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-airflow/commit/87df670a Tree: http://git-wip-us.apache.org/repos/asf/incubator-airflow/tree/87df670a Diff: http://git-wip-us.apache.org/repos/asf/incubator-airflow/diff/87df670a Branch: refs/heads/v1-9-test Commit: 87df670a4ed5b6b0a527972732a6f0c125490935 Parents: 9ba73d7 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:27 2017 +0200 ---------------------------------------------------------------------- airflow/models.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-airflow/blob/87df670a/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:
