예제 #1
0
def test_non_default_cluster():
  NON_DEFAULT_NAME = 'non_default'
  old = cluster.clear_caches()
  reset = (
    conf.HDFS_CLUSTERS.set_for_testing({ NON_DEFAULT_NAME: { } }),
    conf.YARN_CLUSTERS.set_for_testing({ NON_DEFAULT_NAME: { "submit_to": True } }),
  )
  try:
    # This is indeed the only hdfs/mr cluster
    assert_equal(1, len(cluster.get_all_hdfs()))
    assert_true(cluster.get_hdfs(NON_DEFAULT_NAME))

    assert_true(cluster.get_yarn())

    cli = make_logged_in_client()
    # That we can get to a view without errors means that the middlewares work
    cli.get('/about')
  finally:
    for old_conf in reset:
      old_conf()
    cluster.restore_caches(old)
예제 #2
0
파일: tests.py 프로젝트: maduhu/HDP-hue
def test_non_default_cluster():
    NON_DEFAULT_NAME = 'non_default'
    old = cluster.clear_caches()
    reset = (
        conf.HDFS_CLUSTERS.set_for_testing({NON_DEFAULT_NAME: {}}),
        conf.YARN_CLUSTERS.set_for_testing(
            {NON_DEFAULT_NAME: {
                "submit_to": True
            }}),
    )
    try:
        # This is indeed the only hdfs/mr cluster
        assert_equal(1, len(cluster.get_all_hdfs()))
        assert_true(cluster.get_hdfs(NON_DEFAULT_NAME))

        assert_true(cluster.get_yarn())

        cli = make_logged_in_client()
        # That we can get to a view without errors means that the middlewares work
        cli.get('/about')
    finally:
        for old_conf in reset:
            old_conf()
        cluster.restore_caches(old)
예제 #3
0
파일: conf.py 프로젝트: Houxi/hueOriginal
def get_security_default():
  '''Get default security value from Hadoop'''
  from hadoop import cluster # Avoid dependencies conflicts
  cluster = cluster.get_yarn()

  return cluster.SECURITY_ENABLED.get()