You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by od...@apache.org on 2013/10/10 18:27:18 UTC

git commit: AMBARI-3479. During ambari-server setup-security (jaas/https) default value should be visible to users(Artem Baranchuk via odiachenko)

Updated Branches:
  refs/heads/trunk f9d8b55f7 -> 3571423f6


AMBARI-3479. During ambari-server setup-security (jaas/https) default value should be visible to users(Artem Baranchuk via odiachenko)


Project: http://git-wip-us.apache.org/repos/asf/incubator-ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ambari/commit/3571423f
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ambari/tree/3571423f
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ambari/diff/3571423f

Branch: refs/heads/trunk
Commit: 3571423f61b298ec6d2289adc62e14f6e04f01ab
Parents: f9d8b55
Author: Oleksandr Diachenko <od...@hortonworks.com>
Authored: Thu Oct 10 19:26:55 2013 +0300
Committer: Oleksandr Diachenko <od...@hortonworks.com>
Committed: Thu Oct 10 19:27:07 2013 +0300

----------------------------------------------------------------------
 ambari-server/src/main/python/ambari-server.py    |  2 +-
 ambari-server/src/test/python/TestAmbariServer.py | 16 +++++++++++++++-
 2 files changed, 16 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/3571423f/ambari-server/src/main/python/ambari-server.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/python/ambari-server.py b/ambari-server/src/main/python/ambari-server.py
index 1e98985..8987168 100755
--- a/ambari-server/src/main/python/ambari-server.py
+++ b/ambari-server/src/main/python/ambari-server.py
@@ -3652,7 +3652,7 @@ def setup_ambari_krb5_jaas():
     print 'Setting up Ambari kerberos JAAS configuration to access ' +\
           'secured Hadoop daemons...'
     principal = get_validated_string_input('Enter ambari server\'s kerberos '
-                  'principal name: ', 'ambari@EXAMPLE.COM', '.*', '', False,
+                  'principal name (ambari@EXAMPLE.COM): ', 'ambari@EXAMPLE.COM', '.*', '', False,
                   False)
     keytab = get_validated_string_input('Enter keytab path for ambari '
                   'server\'s kerberos principal: ',

http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/3571423f/ambari-server/src/test/python/TestAmbariServer.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/TestAmbariServer.py b/ambari-server/src/test/python/TestAmbariServer.py
index 8be692a..c77205a 100644
--- a/ambari-server/src/test/python/TestAmbariServer.py
+++ b/ambari-server/src/test/python/TestAmbariServer.py
@@ -264,8 +264,22 @@ class TestAmbariServer(TestCase):
   def test_setup_ambari_krb5_jaas(self, exists_mock, search_mock,
                                   get_validated_string_input_mock,
                                   fileinput_mock, re_sub_mock):
-    exists_mock.return_value = True
+
     search_mock.return_value = 'filepath'
+    exists_mock.return_value = False
+
+    # Negative case
+    try:
+      ambari_server.setup_ambari_krb5_jaas()
+      self.fail("Should throw exception")
+    except NonFatalException as fe:
+      # Expected
+      self.assertTrue("No jaas config file found at location" in fe.reason)
+      pass
+
+    # Positive case
+    exists_mock.reset_mock()
+    exists_mock.return_value = True
     get_validated_string_input_mock.side_effect = ['aaa@aaa.cnn',
                                                    'pathtokeytab']