You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by nc...@apache.org on 2018/01/26 15:22:25 UTC

[ambari] 20/21: AMBARI-22782. Fix Namenode alerts broken due to enabling federation (aonishuk)

This is an automated email from the ASF dual-hosted git repository.

ncole pushed a commit to branch branch-feature-AMBARI-21674
in repository https://gitbox.apache.org/repos/asf/ambari.git

commit ecf5d178b588065a066ddb7dcbf65d1d016c04e6
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
ncole@apache.org.