Quellcode durchsuchen

Revert "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)"

This reverts commit 1c44053d290346eafd24eae1ae28507252d2d327.
Swapan Shridhar vor 8 Jahren
Ursprung
Commit
c4ecdeac80

+ 0 - 2
ambari-agent/src/main/python/ambari_agent/CustomServiceOrchestrator.py

@@ -29,7 +29,6 @@ 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
@@ -123,7 +122,6 @@ 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)

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

@@ -27,7 +27,6 @@ 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
@@ -128,7 +127,16 @@ class PythonExecutor(object):
     Log some useful information after task failure.
     """
     logger.info("Command " + pprint.pformat(pythonCommand) + " failed with exitcode=" + str(result['exitcode']))
-    log_process_information(logger)
+    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"]))
 
   def prepare_process_result(self, returncode, tmpoutfile, tmperrfile, tmpstructedoutfile, timeout=None):
     out, error, structured_out = self.read_result_from_files(tmpoutfile, tmperrfile, tmpstructedoutfile)

+ 0 - 1
ambari-common/src/main/python/resource_management/libraries/functions/__init__.py

@@ -45,7 +45,6 @@ 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"
 

+ 0 - 40
ambari-common/src/main/python/resource_management/libraries/functions/log_process_information.py

@@ -1,40 +0,0 @@
-#!/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"]))