Repository: ambari Updated Branches: refs/heads/branch-2.6 b68b2ea53 -> 2915d563c
AMBARI-22492. A bad WebHDFS request is issued when starting Hive Metastore (amagyar) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/2915d563 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/2915d563 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/2915d563 Branch: refs/heads/branch-2.6 Commit: 2915d563cfd770f8281b341b6ce00c80164da93f Parents: b68b2ea Author: Attila Magyar <[email protected]> Authored: Wed Dec 6 17:07:44 2017 +0100 Committer: Attila Magyar <[email protected]> Committed: Wed Dec 6 21:59:20 2017 +0100 ---------------------------------------------------------------------- .../libraries/providers/hdfs_resource.py | 2 ++ .../HIVE/0.12.0.2.0/package/scripts/hive.py | 10 +++++----- 2 files changed, 7 insertions(+), 5 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/2915d563/ambari-common/src/main/python/resource_management/libraries/providers/hdfs_resource.py ---------------------------------------------------------------------- diff --git a/ambari-common/src/main/python/resource_management/libraries/providers/hdfs_resource.py b/ambari-common/src/main/python/resource_management/libraries/providers/hdfs_resource.py index 0c45719..0028e84 100644 --- a/ambari-common/src/main/python/resource_management/libraries/providers/hdfs_resource.py +++ b/ambari-common/src/main/python/resource_management/libraries/providers/hdfs_resource.py @@ -204,6 +204,8 @@ class WebHDFSUtil: depending on if query was successful or not, we can assert this for them """ target = HdfsResourceProvider.parse_path(target) + if not target: + raise Fail("Target cannot be empty") url = format("{address}/webhdfs/v1{target}?op={operation}", address=self.address) request_args = kwargs http://git-wip-us.apache.org/repos/asf/ambari/blob/2915d563/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hive.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hive.py b/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hive.py index 603bc92..0822320 100644 --- a/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hive.py +++ b/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hive.py @@ -213,14 +213,14 @@ def hive(name=None): owner=params.hive_user, group=params.hdfs_user, mode=0777) # Hive expects this dir to be writeable by everyone as it is used as a temp dir - if params.hive_repl_cmrootdir is not None: + if params.hive_repl_cmrootdir: params.HdfsResource(params.hive_repl_cmrootdir, type = "directory", action = "create_on_execute", owner = params.hive_user, group=params.user_group, mode = 01777) - if params.hive_repl_rootdir is not None: + if params.hive_repl_rootdir: params.HdfsResource(params.hive_repl_rootdir, type = "directory", action = "create_on_execute", @@ -338,21 +338,21 @@ def hive(name=None): create_parents = True, mode=0777) - if params.hive_repl_cmrootdir is not None: + if params.hive_repl_cmrootdir: params.HdfsResource(params.hive_repl_cmrootdir, type = "directory", action = "create_on_execute", owner = params.hive_user, group=params.user_group, mode = 01777) - if params.hive_repl_rootdir is not None: + if params.hive_repl_rootdir: params.HdfsResource(params.hive_repl_rootdir, type = "directory", action = "create_on_execute", owner = params.hive_user, group=params.user_group, mode = 0700) - if params.hive_repl_cmrootdir is not None or params.hive_repl_rootdir is not None: + if params.hive_repl_cmrootdir or params.hive_repl_rootdir: params.HdfsResource(None, action="execute") elif name == 'hiveserver2':
