Parcourir la source

AMBARI-3623. LiveStatus of the component is not updated when username is changed. (Artem Baranchuk via odiachenko)

Oleksandr Diachenko il y a 11 ans
Parent
commit
5ca0c22d45

+ 1 - 1
ambari-agent/src/main/python/ambari_agent/StatusCheck.py

@@ -67,7 +67,7 @@ class StatusCheck:
   def __init__(self, serviceToPidDict, pidPathesVars, globalConfig,
     servicesToLinuxUser):
     
-    self.serToPidDict = serviceToPidDict
+    self.serToPidDict = serviceToPidDict.copy()
     self.pidPathesVars = pidPathesVars
     self.pidPathes = []
     self.sh = shellRunner()

+ 3 - 0
ambari-agent/src/test/python/TestStatusCheck.py

@@ -87,6 +87,9 @@ class TestStatusCheck(TestCase):
     statusCheck = StatusCheck(self.serviceToPidDict, self.pidPathesVars,
       self.globalConfig, self.servicesToLinuxUser)
 
+    self.assertTrue(StatusCheck.USER_PATTERN in self.serviceToPidDict[COMPONENT_LIVE])
+    self.assertTrue(StatusCheck.USER_PATTERN in self.serviceToPidDict[COMPONENT_DEAD])
+
     statusCheck.pidFilesDict = self.pidFilesDict
     
     get_is_live_mock.side_effect = lambda pid_path : self.is_live_values[pid_path]