ソースを参照

AMBARI-10628 - HDPWIN deployment fails with cryptic message when hdp.msi is missing under resources folder (Eugene Chekanskiy via abaranchuk)

Artem Baranchuk 10 年 前
コミット
00ea696531

+ 5 - 2
ambari-agent/src/main/python/ambari_agent/PythonExecutor.py

@@ -112,8 +112,11 @@ class PythonExecutor:
     Log some useful information after task failure.
     """
     logger.info("Command " + pprint.pformat(pythonCommand) + " failed with exitcode=" + str(result['exitcode']))
-    cmd_list = ["ps faux", "netstat -tulpn"]
-    
+    if OSCheck.is_windows_family():
+      cmd_list = ["WMIC path win32_process get Caption,Processid,Commandline", "netstat -an"]
+    else:
+      cmd_list = ["ps faux", "netstat -tulpn"]
+
     shell_runner = shellRunner()
     
     for cmd in cmd_list:

+ 2 - 3
ambari-common/src/main/python/ambari_commons/shell.py

@@ -76,9 +76,8 @@ class shellRunnerWindows(shellRunner):
   def run(self, script, user=None):
     logger.warn("user argument ignored on windows")
     code = 0
-    if not isinstance(script, list):
-      cmd = " "
-      cmd = cmd.join(script)
+    if isinstance(script, list):
+      cmd = " ".join(script)
     else:
       cmd = script
     p = subprocess.Popen(cmd, stdout=subprocess.PIPE,

+ 4 - 1
ambari-common/src/main/python/resource_management/libraries/functions/install_hdp_msi.py

@@ -178,7 +178,10 @@ def install_windows_msi(msi_url, save_dir, save_file, hadoop_password, stack_ver
       hdp_22_specific_props = hdp_22.format(hdp_data_dir=hdp_data_dir)
 
     # install msi
-    download_file(msi_url, os.path.join(msi_save_dir, save_file))
+    try:
+      download_file(msi_url, os.path.join(msi_save_dir, save_file))
+    except:
+      raise Fail("Failed to download {url}".format(url=msi_url))
     File(os.path.join(msi_save_dir, "properties.txt"), content=cluster_properties.format(hdp_log_dir=hdp_log_dir,
                                                                                          hdp_data_dir=hdp_data_dir,
                                                                                          local_host=local_host,