Repository: ambari Updated Branches: refs/heads/trunk c7640d0db -> ac56341dc
AMBARI-4912. Trying to run ambari-server setup with -j fails.(vbrodetskyi) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/ac56341d Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/ac56341d Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/ac56341d Branch: refs/heads/trunk Commit: ac56341dce06301de193c3bdac6070aab127e9d7 Parents: c7640d0 Author: Vitaly Brodetskyi <[email protected]> Authored: Mon Mar 3 16:21:20 2014 +0200 Committer: Vitaly Brodetskyi <[email protected]> Committed: Mon Mar 3 16:21:20 2014 +0200 ---------------------------------------------------------------------- ambari-server/src/main/python/ambari-server.py | 9 --------- .../src/test/python/TestAmbariServer.py | 21 ++++++++++---------- 2 files changed, 11 insertions(+), 19 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/ac56341d/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 c4fa246..c8abe47 100755 --- a/ambari-server/src/main/python/ambari-server.py +++ b/ambari-server/src/main/python/ambari-server.py @@ -1674,15 +1674,6 @@ def download_jdk(args): err = "Path to java home " + args.java_home + " does not exists" raise FatalException(1, err) - jce_policy_paths = [] - for jce_file in JCE_POLICY_FILENAMES: - jce_policy_path = os.path.join(properties[RESOURCES_DIR_PROPERTY], jce_file) - if os.path.exists(jce_policy_path): - jce_policy_paths.append(jce_policy_path) - if len(jce_policy_paths) > 0: - err = "Command failed to execute. Please remove or move " + str(jce_policy_paths).strip('[]') + " and retry again" - raise FatalException(1, err) - print_warning_msg("JAVA_HOME " + args.java_home + " must be valid on ALL hosts") print_warning_msg(jcePolicyWarn) write_property(JAVA_HOME_PROPERTY, args.java_home) http://git-wip-us.apache.org/repos/asf/ambari/blob/ac56341d/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 ca85b77..7281e0b 100644 --- a/ambari-server/src/test/python/TestAmbariServer.py +++ b/ambari-server/src/test/python/TestAmbariServer.py @@ -1943,22 +1943,23 @@ MIIFHjCCAwYCCQDpHKOBI+Lt0zANBgkqhkiG9w0BAQUFADBRMQswCQYDVQQGEwJV # Test case: Negative test case JAVA_HOME location should not be updated if -j option is supplied and # jce_policy file already exists in resources dir. - write_property_mock.reset_mock() - args.java_home = "somewhere" - path_existsMock.side_effect = None - path_existsMock.return_value = True - get_JAVA_HOME_mock.return_value = True - try: - ambari_server.download_jdk(args) - self.fail("Should throw exception") - except FatalException as fe: + #write_property_mock.reset_mock() + #args.java_home = "somewhere" + #path_existsMock.side_effect = None + #path_existsMock.return_value = True + #get_JAVA_HOME_mock.return_value = True + #try: + # ambari_server.download_jdk(args) + # self.fail("Should throw exception") + #except FatalException as fe: # Expected - self.assertFalse(write_property_mock.called) + # self.assertFalse(write_property_mock.called) # Test case: Setup ambari-server first time, Custom JDK selected, JDK exists args.java_home = None args.jdk_location = None write_property_mock.reset_mock() remove_property_mock.reset_mock() + path_existsMock.side_effect = None path_existsMock.return_value = True get_validated_string_input_mock.return_value = "3" get_JAVA_HOME_mock.return_value = False
