You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by ab...@apache.org on 2015/04/24 19:04:39 UTC
[3/3] ambari git commit: AMBARI-10628 - HDPWIN deployment fails with
cryptic message when hdp.msi is missing under resources folder (Eugene
Chekanskiy via abaranchuk)
AMBARI-10628 - HDPWIN deployment fails with cryptic message when hdp.msi is missing under resources folder (Eugene Chekanskiy via abaranchuk)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/00ea6965
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/00ea6965
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/00ea6965
Branch: refs/heads/trunk
Commit: 00ea696531fe15435c81b05eae66e0de442c1c2b
Parents: 43c8cd4
Author: Artem Baranchuk <ab...@hortonworks.con>
Authored: Fri Apr 24 20:04:00 2015 +0300
Committer: Artem Baranchuk <ab...@hortonworks.con>
Committed: Fri Apr 24 20:04:00 2015 +0300
----------------------------------------------------------------------
ambari-agent/src/main/python/ambari_agent/PythonExecutor.py | 7 +++++--
ambari-common/src/main/python/ambari_commons/shell.py | 5 ++---
.../libraries/functions/install_hdp_msi.py | 5 ++++-
3 files changed, 11 insertions(+), 6 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/00ea6965/ambari-agent/src/main/python/ambari_agent/PythonExecutor.py
----------------------------------------------------------------------
diff --git a/ambari-agent/src/main/python/ambari_agent/PythonExecutor.py b/ambari-agent/src/main/python/ambari_agent/PythonExecutor.py
index 09be145..42e3861 100644
--- a/ambari-agent/src/main/python/ambari_agent/PythonExecutor.py
+++ b/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:
http://git-wip-us.apache.org/repos/asf/ambari/blob/00ea6965/ambari-common/src/main/python/ambari_commons/shell.py
----------------------------------------------------------------------
diff --git a/ambari-common/src/main/python/ambari_commons/shell.py b/ambari-common/src/main/python/ambari_commons/shell.py
index 4531cf9..8d26599 100644
--- a/ambari-common/src/main/python/ambari_commons/shell.py
+++ b/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,
http://git-wip-us.apache.org/repos/asf/ambari/blob/00ea6965/ambari-common/src/main/python/resource_management/libraries/functions/install_hdp_msi.py
----------------------------------------------------------------------
diff --git a/ambari-common/src/main/python/resource_management/libraries/functions/install_hdp_msi.py b/ambari-common/src/main/python/resource_management/libraries/functions/install_hdp_msi.py
index 0fa72fe..ddb99e1 100644
--- a/ambari-common/src/main/python/resource_management/libraries/functions/install_hdp_msi.py
+++ b/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,