This is an automated email from the ASF dual-hosted git repository.
aonishuk pushed a commit to branch branch-2.7
in repository https://gitbox.apache.org/repos/asf/ambari.git
The following commit(s) were added to refs/heads/branch-2.7 by this push:
new cc0453f AMBARI-24587. HDI Livy2 fails to restart (aonishuk)
cc0453f is described below
commit cc0453f866892fee0f33564f78ec4b94ee5330f4
Author: Andrew Onishuk <[email protected]>
AuthorDate: Tue Sep 4 00:50:33 2018 +0300
AMBARI-24587. HDI Livy2 fails to restart (aonishuk)
---
.../libraries/providers/hdfs_resource.py | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)
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 e1e5ec6..3c772dd 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
@@ -26,6 +26,7 @@ import os
import pwd
import re
import time
+from urlparse import urlparse
from resource_management.core import shell
from resource_management.core import sudo
from resource_management.core.base import Fail
@@ -90,12 +91,16 @@ class HdfsResourceJar:
if not nameservices:
self.action_delayed_for_nameservice(None, action_name, main_resource)
else:
+ default_fs_protocol = urlparse(main_resource.resource.default_fs).scheme
+
+ if not default_fs_protocol or default_fs_protocol == "viewfs":
+ protocol = dfs_type.lower()
+ else:
+ protocol = default_fs_protocol
+
for nameservice in nameservices:
try:
- if not dfs_type:
- raise Fail("<serviceType> for fileSystem service should be set in
metainfo.xml")
- nameservice = dfs_type.lower() + "://" + nameservice
-
+ nameservice = protocol + "://" + nameservice
self.action_delayed_for_nameservice(nameservice, action_name,
main_resource)
except namenode_ha_utils.NoActiveNamenodeException as ex:
# one of ns can be down (during initial start forexample) no need to
worry for federated cluster