Author: smohanty
Date: Tue May 7 05:35:05 2013
New Revision: 1479764
URL: http://svn.apache.org/r1479764
Log:
AMBARI-2083. Upgrade fails on Sles. (smohanty)
Modified:
incubator/ambari/trunk/CHANGES.txt
incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java
incubator/ambari/trunk/ambari-server/src/main/python/ambari-server.py
incubator/ambari/trunk/ambari-server/src/test/python/TestAmbaryServer.py
Modified: incubator/ambari/trunk/CHANGES.txt
URL:
http://svn.apache.org/viewvc/incubator/ambari/trunk/CHANGES.txt?rev=1479764&r1=1479763&r2=1479764&view=diff
==============================================================================
--- incubator/ambari/trunk/CHANGES.txt (original)
+++ incubator/ambari/trunk/CHANGES.txt Tue May 7 05:35:05 2013
@@ -828,6 +828,8 @@ Trunk (unreleased changes):
BUG FIXES
+ AMBARI-2083. Upgrade fails on Sles. (smohanty)
+
AMBARI-2082. Oozie service check fails. (jaimin)
AMBARI-2081. changeUid.sh failing during installation. (swagle)
Modified:
incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java
URL:
http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java?rev=1479764&r1=1479763&r2=1479764&view=diff
==============================================================================
---
incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java
(original)
+++
incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java
Tue May 7 05:35:05 2013
@@ -1404,11 +1404,9 @@ public class AmbariManagementControllerI
+ " should not be null");
}
- if (LOG.isDebugEnabled()) {
- LOG.debug("Received a updateCluster request"
- + ", clusterName=" + request.getClusterName()
- + ", request=" + request);
- }
+ LOG.info("Received a updateCluster request"
+ + ", clusterName=" + request.getClusterName()
+ + ", request=" + request);
final Cluster cluster = clusters.getCluster(request.getClusterName());
@@ -2407,12 +2405,10 @@ public class AmbariManagementControllerI
+ " and service name should be provided to update services");
}
- if (LOG.isDebugEnabled()) {
- LOG.debug("Received a updateService request"
- + ", clusterName=" + request.getClusterName()
- + ", serviceName=" + request.getServiceName()
- + ", request=" + request.toString());
- }
+ LOG.info("Received a updateService request"
+ + ", clusterName=" + request.getClusterName()
+ + ", serviceName=" + request.getServiceName()
+ + ", request=" + request.toString());
clusterNames.add(request.getClusterName());
@@ -4142,6 +4138,11 @@ public class AmbariManagementControllerI
stage.setStageId(0);
for (ActionRequest actionRequest : request) {
+ LOG.info("Received a createAction request"
+ + ", clusterName=" + actionRequest.getClusterName()
+ + ", serviceName=" + actionRequest.getServiceName()
+ + ", request=" + actionRequest.toString());
+
if (actionRequest.getActionName().contains("SERVICE_CHECK")) {
addServiceCheckAction(actionRequest, stage);
} else if
(actionRequest.getActionName().equals("DECOMMISSION_DATANODE")) {
Modified: incubator/ambari/trunk/ambari-server/src/main/python/ambari-server.py
URL:
http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-server/src/main/python/ambari-server.py?rev=1479764&r1=1479763&r2=1479764&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-server/src/main/python/ambari-server.py
(original)
+++ incubator/ambari/trunk/ambari-server/src/main/python/ambari-server.py Tue
May 7 05:35:05 2013
@@ -453,12 +453,21 @@ def get_ambari_jars():
def get_share_jars():
- return JAVA_SHARE_PATH
+ share_jars = ""
+ file_list = []
+ file_list.extend(glob.glob(JAVA_SHARE_PATH + os.sep + "*mysql*"))
+ file_list.extend(glob.glob(JAVA_SHARE_PATH + os.sep + "*oracle*"))
+ if len(file_list) > 0:
+ share_jars = string.join(file_list, os.pathsep)
+ return share_jars
+
def get_ambari_classpath():
- ambari_cp = get_ambari_jars()+os.sep+"*"
- share_cp = get_share_jars()+os.sep+"*"
- return ambari_cp+os.pathsep+share_cp
+ ambari_cp = get_ambari_jars() + os.sep + "*"
+ share_cp = get_share_jars()
+ if len(share_cp) > 0:
+ ambari_cp = ambari_cp + os.pathsep + share_cp
+ return ambari_cp
def get_conf_dir():
Modified:
incubator/ambari/trunk/ambari-server/src/test/python/TestAmbaryServer.py
URL:
http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-server/src/test/python/TestAmbaryServer.py?rev=1479764&r1=1479763&r2=1479764&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-server/src/test/python/TestAmbaryServer.py
(original)
+++ incubator/ambari/trunk/ambari-server/src/test/python/TestAmbaryServer.py
Tue May 7 05:35:05 2013
@@ -618,18 +618,32 @@ class TestAmbariServer(TestCase):
self.assertTrue(printInfoMsg_mock.called)
+ @patch("glob.glob")
@patch.object(ambari_server, "print_info_msg")
- def test_get_share_jars(self, printInfoMsg_mock):
- expected = "/usr/share/java"
+ def test_get_share_jars(self, printInfoMsg_mock, globMock):
+ globMock.return_value = ["one", "two"]
+ expected = "one:two:one:two"
+ result = ambari_server.get_share_jars()
+ self.assertEqual(expected, result)
+ globMock.return_value = []
+ expected = ""
result = ambari_server.get_share_jars()
self.assertEqual(expected, result)
+
+ @patch("glob.glob")
@patch.object(ambari_server, "print_info_msg")
- def test_get_ambari_classpath(self, printInfoMsg_mock):
+ def test_get_ambari_classpath(self, printInfoMsg_mock, globMock):
+ globMock.return_value = ["one"]
result = ambari_server.get_ambari_classpath()
print result
self.assertTrue(ambari_server.get_ambari_jars() in result)
self.assertTrue(ambari_server.get_share_jars() in result)
+ globMock.return_value = []
+ result = ambari_server.get_ambari_classpath()
+ print result
+ self.assertTrue(ambari_server.get_ambari_jars() in result)
+ self.assertFalse(":" in result)
@patch.object(ambari_server, "print_info_msg")