You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by ad...@apache.org on 2018/04/18 18:32:13 UTC

[ambari] branch trunk updated: AMBARI-23610. Enable NameNode HA fails after Ambari upgrade (#1040)

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

adoroszlai 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 cb8e8d5  AMBARI-23610. Enable NameNode HA fails after Ambari upgrade (#1040)
cb8e8d5 is described below

commit cb8e8d5a8f6025f940db03b47cec502a7b9cb1a5
Author: Doroszlai, Attila <64...@users.noreply.github.com>
AuthorDate: Wed Apr 18 20:32:10 2018 +0200

    AMBARI-23610. Enable NameNode HA fails after Ambari upgrade (#1040)
---
 .../python/ambari_agent/ConfigurationBuilder.py    |  2 +-
 .../ambari_agent/TestConfigurationBuilder.py       | 34 ++++++++++++++++++++++
 2 files changed, 35 insertions(+), 1 deletion(-)

diff --git a/ambari-agent/src/main/python/ambari_agent/ConfigurationBuilder.py b/ambari-agent/src/main/python/ambari_agent/ConfigurationBuilder.py
index fb912fb..2daa12d 100644
--- a/ambari-agent/src/main/python/ambari_agent/ConfigurationBuilder.py
+++ b/ambari-agent/src/main/python/ambari_agent/ConfigurationBuilder.py
@@ -80,4 +80,4 @@ class ConfigurationBuilder:
 
   @property
   def public_fqdn(self):
-    hostname.public_hostname(self.config)
\ No newline at end of file
+    return hostname.public_hostname(self.config)
diff --git a/ambari-agent/src/test/python/ambari_agent/TestConfigurationBuilder.py b/ambari-agent/src/test/python/ambari_agent/TestConfigurationBuilder.py
new file mode 100644
index 0000000..71c1a12
--- /dev/null
+++ b/ambari-agent/src/test/python/ambari_agent/TestConfigurationBuilder.py
@@ -0,0 +1,34 @@
+#!/usr/bin/env python
+
+'''
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+'''
+
+from mock.mock import MagicMock, patch
+from unittest import TestCase
+
+from ambari_agent.ConfigurationBuilder import ConfigurationBuilder
+from ambari_agent.InitializerModule import InitializerModule
+
+class TestConfigurationBuilder(TestCase):
+
+  @patch("ambari_agent.hostname.public_hostname", new = MagicMock(return_value='c6401.ambari.apache.org'))
+  def test_public_fqdn(self):
+    initializer_module = InitializerModule()
+
+    config_builder = ConfigurationBuilder(initializer_module)
+    self.assertEqual('c6401.ambari.apache.org', config_builder.public_fqdn)

-- 
To stop receiving notification emails like this one, please contact
adoroszlai@apache.org.