You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by ao...@apache.org on 2018/01/26 14:01:57 UTC
[ambari] 01/02: AMBARI-22782. Fix Namenode alerts broken due to
enabling federation (aonishuk)
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
commit 649771469b811f292a7a310b3a48c8ad302b4a5d
Author: Andrew Onishuk <ao...@hortonworks.com>
AuthorDate: Mon Jan 15 13:03:19 2018 +0200
AMBARI-22782. Fix Namenode alerts broken due to enabling federation (aonishuk)
---
.../libraries/functions/namenode_ha_utils.py | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)
diff --git a/ambari-common/src/main/python/resource_management/libraries/functions/namenode_ha_utils.py b/ambari-common/src/main/python/resource_management/libraries/functions/namenode_ha_utils.py
index 8a2ff25..7a2635f 100644
--- a/ambari-common/src/main/python/resource_management/libraries/functions/namenode_ha_utils.py
+++ b/ambari-common/src/main/python/resource_management/libraries/functions/namenode_ha_utils.py
@@ -239,11 +239,13 @@ def get_nameservice(hdfs_site):
"""
name_service = hdfs_site.get('dfs.internal.nameservices', None)
if not name_service:
- import re
name_service = hdfs_site.get('dfs.nameservices', None)
- if name_service:
- for ns in name_service.split(","):
- if 'dfs.namenode.shared.edits.dir' in hdfs_site and re.match(r'.*%s$' % ns, hdfs_site['dfs.namenode.shared.edits.dir']): # better would be core_site['fs.defaultFS'] but it's not available
- return ns
- return name_service.split(",")[0] # default to return the first nameservice
+
+ if name_service and ',' in name_service:
+ import re
+ for ns in name_service.split(","):
+ if 'dfs.namenode.shared.edits.dir' in hdfs_site and re.match(r'.*%s$' % ns, hdfs_site['dfs.namenode.shared.edits.dir']): # better would be core_site['fs.defaultFS'] but it's not available
+ return ns
+ return name_service.split(",")[0] # default to return the first nameservice
+
return name_service
--
To stop receiving notification emails like this one, please contact
aonishuk@apache.org.