Updated Branches: refs/heads/branch-1.4 3084ff466 -> f4aab384b
AMBARI-2975. ambari-server setup -j cannot update java.home. (Vladimir Tkhir via mahadev) Project: http://git-wip-us.apache.org/repos/asf/incubator-ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-ambari/commit/f4aab384 Tree: http://git-wip-us.apache.org/repos/asf/incubator-ambari/tree/f4aab384 Diff: http://git-wip-us.apache.org/repos/asf/incubator-ambari/diff/f4aab384 Branch: refs/heads/branch-1.4 Commit: f4aab384b63b5193093eabb4843923ee69adc9fd Parents: 3084ff4 Author: Mahadev Konar <[email protected]> Authored: Wed Aug 21 22:51:50 2013 -0700 Committer: Mahadev Konar <[email protected]> Committed: Wed Aug 21 22:52:22 2013 -0700 ---------------------------------------------------------------------- ambari-server/src/main/python/ambari-server.py | 2 +- ambari-server/src/test/python/TestAmbaryServer.py | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/f4aab384/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 6a59b11..99a341b 100755 --- a/ambari-server/src/main/python/ambari-server.py +++ b/ambari-server/src/main/python/ambari-server.py @@ -1522,7 +1522,7 @@ def download_jdk(args): raise FatalException(-1, err) conf_file = properties.fileName ok = False - if get_JAVA_HOME(): + if get_JAVA_HOME() and not args.java_home: pass # do nothing elif args.java_home and os.path.exists(args.java_home): print_warning_msg("JAVA_HOME " + args.java_home http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/f4aab384/ambari-server/src/test/python/TestAmbaryServer.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/test/python/TestAmbaryServer.py b/ambari-server/src/test/python/TestAmbaryServer.py index 74c1166..4786ca0 100644 --- a/ambari-server/src/test/python/TestAmbaryServer.py +++ b/ambari-server/src/test/python/TestAmbaryServer.py @@ -1582,6 +1582,15 @@ MIIFHjCCAwYCCQDpHKOBI+Lt0zANBgkqhkiG9w0BAQUFADBRMQswCQYDVQQGEwJV rcode = ambari_server.download_jdk(args) self.assertTrue(download_jce_policy_mock.called) + # Test case: Update JAVA_HOME location using command: ambari-server setup -j %NEW_LOCATION% + write_property_mock.reset_mock() + args.java_home = "somewhere" + path_existsMock.return_value = True + path_existsMock.side_effect = None + get_JAVA_HOME_mock.return_value = True + install_jce_manualy_mock.return_value = 0 + rcode = ambari_server.download_jdk(args) + self.assertTrue(write_property_mock.called) @patch.object(ambari_server, "run_os_command")
