Repository: incubator-airflow
Updated Branches:
  refs/heads/master 5ac8ff105 -> 477944c96


[AIRFLOW-414] Improve error message for missing FERNET_KEY

Closes #1724 from r39132/more_descriptive_error


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

Branch: refs/heads/master
Commit: 477944c96b9a3143dfb35f7a66e6553c50cb558e
Parents: 5ac8ff1
Author: Siddharth Anand <siddharthan...@yahoo.com>
Authored: Wed Aug 10 21:23:17 2016 -0400
Committer: jlowin <jlo...@users.noreply.github.com>
Committed: Wed Aug 10 21:23:17 2016 -0400

----------------------------------------------------------------------
 airflow/models.py | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-airflow/blob/477944c9/airflow/models.py
----------------------------------------------------------------------
diff --git a/airflow/models.py b/airflow/models.py
index d9f2f16..df51be5 100644
--- a/airflow/models.py
+++ b/airflow/models.py
@@ -541,7 +541,8 @@ class Connection(Base):
         if self._password and self.is_encrypted:
             if not ENCRYPTION_ON:
                 raise AirflowException(
-                    "Can't decrypt, configuration is missing")
+                    "Can't decrypt encrypted password for login={}, \
+                    FERNET_KEY configuration is missing".format(self.login))
             return FERNET.decrypt(bytes(self._password, 'utf-8')).decode()
         else:
             return self._password
@@ -564,7 +565,8 @@ class Connection(Base):
         if self._extra and self.is_extra_encrypted:
             if not ENCRYPTION_ON:
                 raise AirflowException(
-                    "Can't decrypt `extra`, configuration is missing")
+                    "Can't decrypt `extra` params for login={},\
+                    FERNET_KEY configuration is missing".format(self.login))
             return FERNET.decrypt(bytes(self._extra, 'utf-8')).decode()
         else:
             return self._extra
@@ -3402,7 +3404,8 @@ class Variable(Base):
         if self._val and self.is_encrypted:
             if not ENCRYPTION_ON:
                 raise AirflowException(
-                    "Can't decrypt _val, configuration is missing")
+                    "Can't decrypt _val for key={}, FERNET_KEY configuration \
+                    missing".format(self.key))
             return FERNET.decrypt(bytes(self._val, 'utf-8')).decode()
         else:
             return self._val

Reply via email to