Browse Source

AMBARI-4061. Upgraded cluster may be missing yarn job summary entries.

Sumit Mohanty 11 years ago
parent
commit
9c2cbdb076

+ 3 - 1
ambari-server/src/main/python/UpgradeHelper_HDP2.py

@@ -988,7 +988,7 @@ def backup_single_config_type(options, type, error_if_na=True):
 
 def install_services(options):
   SERVICE_URL_FORMAT = URL_FORMAT + '/services/{2}'
-  SERVICES = ["YARN", "MAPREDUCE2"]
+  SERVICES = ["MAPREDUCE2", "YARN"]
   PUT_IN_INSTALLED = ["""{"RequestInfo":{"context":"Install MapReduce2"}, "Body":{"ServiceInfo": {"state":"INSTALLED"}}}""",
                       """{"RequestInfo":{"context":"Install YARN"}, "Body":{"ServiceInfo": {"state":"INSTALLED"}}}"""]
   err_retcode = 0
@@ -1091,6 +1091,8 @@ def main():
   action = args[0]
 
   options.exit_message = "Upgrade action '%s' completed successfully." % action
+  if options.printonly:
+    options.exit_message = "Simulated execution of action '%s'. Verify the list edit calls." % action
 
   backup_file(options.logfile)
   global logger

+ 4 - 4
ambari-server/src/test/python/TestUpgradeScript_HDP2.py

@@ -258,12 +258,12 @@ class TestUpgradeHDP2Script(TestCase):
     curl_mock.return_value = '"href" : "'
     UpgradeHelper_HDP2.main()
     expected_curl_calls = [
-      call(False, "-u", "admin:admin", '-H', 'X-Requested-By: ambari', "-X", "PUT", "-d",
-           """{"RequestInfo":{"context":"Install YARN"}, "Body":{"ServiceInfo": {"state":"INSTALLED"}}}""",
-           "http://localhost:8080/api/v1/clusters/c1/services/YARN"),
       call(False, "-u", "admin:admin", '-H', 'X-Requested-By: ambari', "-X", "PUT", "-d",
            """{"RequestInfo":{"context":"Install MapReduce2"}, "Body":{"ServiceInfo": {"state":"INSTALLED"}}}""",
-           "http://localhost:8080/api/v1/clusters/c1/services/MAPREDUCE2")]
+           "http://localhost:8080/api/v1/clusters/c1/services/MAPREDUCE2"),
+      call(False, "-u", "admin:admin", '-H', 'X-Requested-By: ambari', "-X", "PUT", "-d",
+           """{"RequestInfo":{"context":"Install YARN"}, "Body":{"ServiceInfo": {"state":"INSTALLED"}}}""",
+           "http://localhost:8080/api/v1/clusters/c1/services/YARN")]
     curl_mock.assert_has_calls(expected_curl_calls, any_order=False)
     pass