This is an automated email from the ASF dual-hosted git repository.
aonishuk pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/ambari.git
The following commit(s) were added to refs/heads/trunk by this push:
new 6444258 AMBARI-24587. HDI Livy2 fails to restart (aonishuk)
6444258 is described below
commit 64442589e41cbecce49376e73a28972c3b88eb4e
Author: Andrew Onishuk <[email protected]>
AuthorDate: Tue Sep 4 00:50:41 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 ccd3407..468c3cf 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