Переглянути джерело

AMBARI-10049. ambari agent logs show knox master pwd (aonishuk)

Andrew Onishuk 10 роки тому
батько
коміт
bdfd5d0546

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

@@ -93,7 +93,6 @@ class ActionQueue(threading.Thread):
       logger.info("Adding " + command['commandType'] + " for service " + \
                     command['serviceName'] + " of cluster " + \
                     command['clusterName'] + " to the queue.")
-      logger.debug(pprint.pformat(command))
       self.statusCommandQueue.put(command)
 
   def put(self, commands):
@@ -106,7 +105,6 @@ class ActionQueue(threading.Thread):
       logger.info("Adding " + command['commandType'] + " for service " + \
                   command['serviceName'] + " of cluster " + \
                   command['clusterName'] + " to the queue.")
-      logger.debug(pprint.pformat(command))
       if command['commandType'] == self.BACKGROUND_EXECUTION_COMMAND :
         self.backgroundCommandQueue.put(self.createCommandHandle(command))
       else:
@@ -172,9 +170,9 @@ class ActionQueue(threading.Thread):
     return command
 
   def process_command(self, command):
-    logger.debug("Took an element of Queue: " + pprint.pformat(command))
     # make sure we log failures
     commandType = command['commandType']
+    logger.debug("Took an element of Queue (command type = %s)." % commandType)
     try:
       if commandType in [self.EXECUTION_COMMAND, self.BACKGROUND_EXECUTION_COMMAND]:
         self.execute_command(command)
@@ -199,7 +197,6 @@ class ActionQueue(threading.Thread):
               commandId = str(commandId), role=command['role'],
               cluster=clusterName)
     logger.info(message)
-    logger.debug(pprint.pformat(command))
 
     taskId = command['taskId']
     # Preparing 'IN_PROGRESS' report

+ 4 - 7
ambari-agent/src/main/python/ambari_agent/Controller.py

@@ -144,12 +144,12 @@ class Controller(threading.Thread):
           self.repeatRegistration = False
           return ret
 
-        logger.info("Registration Successful (response=%s)", pprint.pformat(ret))
-
         self.responseId = int(ret['responseId'])
+        logger.info("Registration Successful (response id = %s)", self.responseId)
+
         self.isRegistered = True
         if 'statusCommands' in ret.keys():
-          logger.info("Got status commands on registration " + pprint.pformat(ret['statusCommands']))
+          logger.info("Got status commands on registration.")
           self.addToStatusQueue(ret['statusCommands'])
           pass
         else:
@@ -241,10 +241,7 @@ class Controller(threading.Thread):
 
         serverId = int(response['responseId'])
 
-        if logger.isEnabledFor(logging.DEBUG):
-          logger.debug('Heartbeat response (id = %s): %s', serverId, pprint.pformat(response))
-        else:
-          logger.info('Heartbeat response received (id = %s)', serverId)
+        logger.info('Heartbeat response received (id = %s)', serverId)
 
         if 'hasMappedComponents' in response.keys():
           self.hasMappedComponents = response['hasMappedComponents'] is not False

+ 1 - 0
ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/mysql_users.py

@@ -40,6 +40,7 @@ def mysql_adduser():
   Execute(cmd,
           tries=3,
           try_sleep=5,
+          logoutput=False,
           path='/usr/sbin:/sbin:/usr/local/bin:/bin:/usr/bin'
   )
 

+ 2 - 0
ambari-server/src/test/python/stacks/2.0.6/HIVE/test_mysql_server.py

@@ -145,6 +145,7 @@ class TestMySqlServer(RMFTestCase):
     )
     self.assertResourceCalled('Execute', 'bash -x /tmp/addMysqlUser.sh mysql hive \'!`"\'"\'"\' 1\' c6402.ambari.apache.org',
       path = ['/usr/sbin:/sbin:/usr/local/bin:/bin:/usr/bin'],
+      logoutput = False,
       tries = 3,
       try_sleep = 5
     )
@@ -162,6 +163,7 @@ class TestMySqlServer(RMFTestCase):
     )
     self.assertResourceCalled('Execute', 'bash -x /tmp/addMysqlUser.sh mysql hive \'!`"\'"\'"\' 1\' c6402.ambari.apache.org',
       path = ['/usr/sbin:/sbin:/usr/local/bin:/bin:/usr/bin'],
+      logoutput = False,
       tries = 3,
       try_sleep = 5
     )