Browse Source

[desktop, beeswax, impala] Log config validation exceptions

Erick Tryzelaar 10 years ago
parent
commit
f1acf37e5c

+ 11 - 2
apps/beeswax/src/beeswax/conf.py

@@ -15,6 +15,7 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
+import logging
 import os.path
 import sys
 import beeswax.hive_site
@@ -25,6 +26,8 @@ from desktop.lib.conf import ConfigSection, Config, coerce_bool
 
 from beeswax.settings import NICE_NAME
 
+LOG = logging.getLogger(__name__)
+
 
 HIVE_SERVER_HOST = Config(
   key="hive_server_host",
@@ -141,7 +144,10 @@ def config_validator(user):
       server = dbms.get(user)
       server.get_databases()
   except:
-    res.append((NICE_NAME, _("The application won't work without a running HiveServer2.")))
+    msg = "The application won't work without a running HiveServer2."
+    LOG.exception(msg)
+
+    res.append((NICE_NAME, _(msg)))
 
   try:
     from hadoop import cluster
@@ -149,6 +155,9 @@ def config_validator(user):
     fs = cluster.get_hdfs()
     fs.stats(warehouse)
   except Exception:
-    return [(NICE_NAME, _('Failed to access Hive warehouse: %s') % warehouse)]
+    msg = 'Failed to access Hive warehouse: %s'
+    LOG.exception(msg % warehouse)
+
+    return [(NICE_NAME, _(msg) % warehouse)]
 
   return res

+ 7 - 1
apps/impala/src/impala/conf.py

@@ -15,6 +15,7 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
+import logging
 import sys
 import socket
 
@@ -23,6 +24,8 @@ from desktop.lib.conf import ConfigSection, Config, coerce_bool
 
 from impala.settings import NICE_NAME
 
+LOG = logging.getLogger(__name__)
+
 
 SERVER_HOST = Config(
   key="server_host",
@@ -131,6 +134,9 @@ def config_validator(user):
       server = dbms.get(user, query_server)
       server.get_databases()
   except:
-    res.append((NICE_NAME, _("No available Impalad to send queries to.")))
+    msg = "No available Impalad to send queries to."
+    LOG.exception(msg)
+
+    res.append((NICE_NAME, _(msg)))
 
   return res

+ 3 - 0
desktop/libs/hadoop/src/hadoop/conf.py

@@ -23,6 +23,8 @@ import os
 
 DEFAULT_NN_HTTP_PORT = 50070
 
+LOG = logging.getLogger(__name__)
+
 def find_file_recursive(desired_glob, root):
   def f():
     for dirpath, dirnames, filenames in os.walk(root):
@@ -211,6 +213,7 @@ def test_yarn_configurations():
     api.apps()
   except Exception, e:
     msg = 'Failed to contact Resource Manager at %s: %s' % (url, e)
+    LOG.exception(msg)
     result.append(('Resource Manager', msg))
 
   return result