You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by vb...@apache.org on 2017/02/24 00:21:18 UTC

ambari git commit: AMBARI-20159. Cluster deploy failed as install service failed with "Execution of zypper clean --all returned 7. System management is locked by the application with pid ..."(vbrodetskyi)

Repository: ambari
Updated Branches:
  refs/heads/trunk fc5cbc6e3 -> ef355ae0d


AMBARI-20159. Cluster deploy failed as install service failed with "Execution of zypper clean --all returned 7. System management is locked by the application with pid ..."(vbrodetskyi)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/ef355ae0
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/ef355ae0
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/ef355ae0

Branch: refs/heads/trunk
Commit: ef355ae0d262dc16c8897d89110b3312653e0e68
Parents: fc5cbc6
Author: Vitaly Brodetskyi <vb...@hortonworks.com>
Authored: Fri Feb 24 01:23:30 2017 +0200
Committer: Vitaly Brodetskyi <vb...@hortonworks.com>
Committed: Fri Feb 24 01:24:24 2017 +0200

----------------------------------------------------------------------
 .../ambari_agent/CustomServiceOrchestrator.py   |  2 +
 .../main/python/ambari_agent/PythonExecutor.py  | 12 +-----
 .../libraries/functions/__init__.py             |  1 +
 .../functions/log_process_information.py        | 40 ++++++++++++++++++++
 4 files changed, 45 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/ef355ae0/ambari-agent/src/main/python/ambari_agent/CustomServiceOrchestrator.py
----------------------------------------------------------------------
diff --git a/ambari-agent/src/main/python/ambari_agent/CustomServiceOrchestrator.py b/ambari-agent/src/main/python/ambari_agent/CustomServiceOrchestrator.py
index 9f2852b..8069723 100644
--- a/ambari-agent/src/main/python/ambari_agent/CustomServiceOrchestrator.py
+++ b/ambari-agent/src/main/python/ambari_agent/CustomServiceOrchestrator.py
@@ -29,6 +29,7 @@ from FileCache import FileCache
 from AgentException import AgentException
 from PythonExecutor import PythonExecutor
 from PythonReflectiveExecutor import PythonReflectiveExecutor
+from resource_management.libraries.functions.log_process_information import log_process_information
 from resource_management.core.utils import PasswordString
 import subprocess
 import Constants
@@ -122,6 +123,7 @@ class CustomServiceOrchestrator():
         logger.info("Canceling command with taskId = {tid}, " \
                     "reason - {reason} . Killing process {pid}"
                     .format(tid=str(task_id), reason=reason, pid=pid))
+        log_process_information(logger)
         shell.kill_process_with_children(pid)
       else: 
         logger.warn("Unable to find process associated with taskId = %s" % task_id)

http://git-wip-us.apache.org/repos/asf/ambari/blob/ef355ae0/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 5a896ff..ea6f895 100644
--- a/ambari-agent/src/main/python/ambari_agent/PythonExecutor.py
+++ b/ambari-agent/src/main/python/ambari_agent/PythonExecutor.py
@@ -27,6 +27,7 @@ import platform
 from threading import Thread
 import time
 from BackgroundCommandExecutionHandle import BackgroundCommandExecutionHandle
+from resource_management.libraries.functions.log_process_information import log_process_information
 from ambari_commons.os_check import OSConst, OSCheck
 from Grep import Grep
 import sys
@@ -127,16 +128,7 @@ class PythonExecutor(object):
     Log some useful information after task failure.
     """
     logger.info("Command " + pprint.pformat(pythonCommand) + " failed with exitcode=" + str(result['exitcode']))
-    if OSCheck.is_windows_family():
-      cmd_list = ["WMIC path win32_process get Caption,Processid,Commandline", "netstat -an"]
-    else:
-      cmd_list = ["export COLUMNS=9999 ; ps faux", "netstat -tulpn"]
-
-    shell_runner = shellRunner()
-
-    for cmd in cmd_list:
-      ret = shell_runner.run(cmd)
-      logger.info("Command '{0}' returned {1}. {2}{3}".format(cmd, ret["exitCode"], ret["error"], ret["output"]))
+    log_process_information(logger)
 
   def prepare_process_result(self, returncode, tmpoutfile, tmperrfile, tmpstructedoutfile, timeout=None):
     out, error, structured_out = self.read_result_from_files(tmpoutfile, tmperrfile, tmpstructedoutfile)

http://git-wip-us.apache.org/repos/asf/ambari/blob/ef355ae0/ambari-common/src/main/python/resource_management/libraries/functions/__init__.py
----------------------------------------------------------------------
diff --git a/ambari-common/src/main/python/resource_management/libraries/functions/__init__.py b/ambari-common/src/main/python/resource_management/libraries/functions/__init__.py
index f0c2e13..f144b2d 100644
--- a/ambari-common/src/main/python/resource_management/libraries/functions/__init__.py
+++ b/ambari-common/src/main/python/resource_management/libraries/functions/__init__.py
@@ -45,6 +45,7 @@ from resource_management.libraries.functions.curl_krb_request import *
 from resource_management.libraries.functions.get_bare_principal import *
 from resource_management.libraries.functions.get_path_from_url import *
 from resource_management.libraries.functions.show_logs import *
+from resource_management.libraries.functions.log_process_information import *
 
 IS_WINDOWS = platform.system() == "Windows"
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/ef355ae0/ambari-common/src/main/python/resource_management/libraries/functions/log_process_information.py
----------------------------------------------------------------------
diff --git a/ambari-common/src/main/python/resource_management/libraries/functions/log_process_information.py b/ambari-common/src/main/python/resource_management/libraries/functions/log_process_information.py
new file mode 100644
index 0000000..dff0474
--- /dev/null
+++ b/ambari-common/src/main/python/resource_management/libraries/functions/log_process_information.py
@@ -0,0 +1,40 @@
+#!/usr/bin/env python
+"""
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+
+Ambari Agent
+
+"""
+from ambari_commons.shell import shellRunner
+from ambari_commons.os_check import OSCheck
+
+__all__ = ["log_process_information"]
+
+def log_process_information(logger):
+  """
+  Check if certain configuration sent from the server has been received.
+  """
+  if OSCheck.is_windows_family():
+    cmd_list = ["WMIC path win32_process get Caption,Processid,Commandline", "netstat -an"]
+  else:
+    cmd_list = ["export COLUMNS=9999 ; ps faux", "netstat -tulpn", "ps auxf"]
+
+  shell_runner = shellRunner()
+
+  for cmd in cmd_list:
+    ret = shell_runner.run(cmd)
+    logger.info("Command '{0}' returned {1}. {2}{3}".format(cmd, ret["exitCode"], ret["error"], ret["output"]))