Browse Source

HUE-2534 [hbase] Install the examples with the doas

Romain Rigaux 10 years ago
parent
commit
a483647a75

+ 1 - 1
apps/hbase/src/hbase/api.py

@@ -95,7 +95,7 @@ class HbaseApi(object):
                                   service_name="Hue HBase Thrift Client for %s" % name,
                                   kerberos_principal=_security['kerberos_principal_short_name'],
                                   use_sasl=_security['use_sasl'],
-                                  timeout_seconds=None,
+                                  timeout_seconds=30,
                                   transport=conf.THRIFT_TRANSPORT.get(),
                                   transport_mode=conf.TRANSPORT_MODE.get(),
                                   http_url=\

+ 6 - 1
apps/hbase/src/hbase/management/commands/hbase_setup.py

@@ -17,8 +17,11 @@
 
 import logging
 import os
+import pwd
+
 from datetime import datetime, timedelta
 
+from django.contrib.auth.models import User
 from django.core.management.base import NoArgsCommand
 from django.utils.translation import ugettext as _
 
@@ -27,6 +30,7 @@ from desktop.lib.paths import get_apps_root
 from hbased.ttypes import AlreadyExists
 from hbase.api import HbaseApi
 
+
 LOG = logging.getLogger(__name__)
 
 
@@ -34,7 +38,8 @@ class Command(NoArgsCommand):
   help = 'Create and fill some demo tables in the first configured cluster.'
 
   def handle_noargs(self, **options):
-    api = HbaseApi()
+    user = User.objects.get(username=pwd.getpwuid(os.getuid()).pw_name)
+    api = HbaseApi(user=user)
     cluster_name = api.getClusters()[0]['name'] # Currently pick first configured cluster
 
     # Check connectivity