コード例 #1
0
ファイル: conf.py プロジェクト: ranade1/hue-3
def config_validator(user):
    res = []

    from hbase.api import HbaseApi
    from hbase.settings import NICE_NAME

    try:
        if not 'test' in sys.argv:  # Avoid tests hanging
            api = HbaseApi(user=user)
            cluster_name = api.getClusters()[0][
                'name']  # Currently pick first configured cluster
            # Check connectivity
            api.connectCluster(cluster_name)
            api.getTableList(cluster_name)
    except Exception as e:
        print(e)
        if 'Could not connect' in str(e):
            msg = "The application won't work without a running HBase Thrift Server v1."
        else:
            msg = 'Failed to authenticate to HBase Thrift Server, check authentication configurations.'
        LOG.exception(msg)
        res.append((NICE_NAME, _(msg)))

    if get_thrift_transport() == "framed":
        msg = "Hbase config thrift_transport=framed is not supported"
        LOG.exception(msg)
        res.append((NICE_NAME, _(msg)))

    res.extend(validate_thrift_transport(THRIFT_TRANSPORT))

    return res
コード例 #2
0
    res = []

    from hbase.api import HbaseApi
    from hbase.settings import NICE_NAME

    try:
        if not 'test' in sys.argv:  # Avoid tests hanging
            api = HbaseApi(user=user)
            cluster_name = api.getClusters()[0][
                'name']  # Currently pick first configured cluster
            # Check connectivity
            api.connectCluster(cluster_name)
            api.getTableList(cluster_name)
    except Exception, e:
        print e
        if 'Could not connect' in str(e):
            msg = "The application won't work without a running HBase Thrift Server v1."
        else:
            msg = 'Failed to authenticate to HBase Thrift Server, check authentication configurations.'
        LOG.exception(msg)
        res.append((NICE_NAME, _(msg)))

    if get_thrift_transport() == "framed":
        msg = "Hbase config thrift_transport=framed is not supported"
        LOG.exception(msg)
        res.append((NICE_NAME, _(msg)))

    res.extend(validate_thrift_transport(THRIFT_TRANSPORT))

    return res
コード例 #3
0
ファイル: conf.py プロジェクト: 10sr/hue
  type=coerce_bool
)


def config_validator(user):
  res = []

  from hbase.api import HbaseApi
  from hbase.settings import NICE_NAME

  try:
    if not 'test' in sys.argv: # Avoid tests hanging
      api = HbaseApi(user=user)
      cluster_name = api.getClusters()[0]['name'] # Currently pick first configured cluster
      # Check connectivity
      api.connectCluster(cluster_name)
      api.getTableList(cluster_name)
  except Exception, e:
    print e
    if 'Could not connect' in str(e):
      msg = "The application won't work without a running HBase Thrift Server v1."
    else:
      msg = 'Failed to authenticate to HBase Thrift Server, check authentication configurations.'
    LOG.exception(msg)
    res.append((NICE_NAME, _(msg)))


  res.extend(validate_thrift_transport(THRIFT_TRANSPORT))

  return res
コード例 #4
0
def config_validator(user):
    res = []

    res.extend(validate_thrift_transport(THRIFT_TRANSPORT))

    return res
コード例 #5
0
ファイル: conf.py プロジェクト: mobilist/hue
def config_validator(user):
    res = []

    res.extend(validate_thrift_transport(THRIFT_TRANSPORT))

    return res