ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rle...@apache.org
Subject [35/50] [abbrv] ambari git commit: AMBARI-21096. ADDENDUM. Provide additional logging for config audit log (alejandro)
Date Thu, 08 Jun 2017 19:22:49 GMT
AMBARI-21096. ADDENDUM. Provide additional logging for config audit log (alejandro)


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

Branch: refs/heads/branch-feature-AMBARI-20859
Commit: bdadb704b8982915575ea65d3c42447abcb75d6e
Parents: e801b41
Author: Alejandro Fernandez <afernandez@hortonworks.com>
Authored: Wed Jun 7 11:28:46 2017 -0700
Committer: Alejandro Fernandez <afernandez@hortonworks.com>
Committed: Wed Jun 7 15:15:38 2017 -0700

----------------------------------------------------------------------
 .../server/controller/AmbariManagementControllerImpl.java       | 5 ++++-
 .../server/controller/internal/ConfigGroupResourceProvider.java | 3 ++-
 2 files changed, 6 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/bdadb704/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java
b/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java
index b67b45b..1eeb82b 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java
@@ -1777,7 +1777,10 @@ public class AmbariManagementControllerImpl implements AmbariManagementControlle
             }
           }
           note = cr.getServiceConfigVersionNote();
-          configs.add(cluster.getConfig(configType, cr.getVersionTag()));
+          Config config = cluster.getConfig(configType, cr.getVersionTag());
+          if (null != config) {
+            configs.add(config);
+          }
         }
         if (!configs.isEmpty()) {
           Map<String, Config> existingConfigTypeToConfig = new HashMap();

http://git-wip-us.apache.org/repos/asf/ambari/blob/bdadb704/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ConfigGroupResourceProvider.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ConfigGroupResourceProvider.java
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ConfigGroupResourceProvider.java
index d2b4a84..cc23177 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ConfigGroupResourceProvider.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ConfigGroupResourceProvider.java
@@ -657,10 +657,11 @@ public class ConfigGroupResourceProvider extends
         serviceName = requestServiceName;
       }
 
+      int numHosts = (null != configGroup.getHosts()) ? configGroup.getHosts().size() : 0;
       configLogger.info("(configchange) Updating configuration group host membership or config
value. cluster: '{}', changed by: '{}', " +
               "service_name: '{}', config group: '{}', tag: '{}', num hosts in config group:
'{}', note: '{}'",
           cluster.getClusterName(), getManagementController().getAuthName(),
-          serviceName, request.getGroupName(), request.getTag(), configGroup.getHosts().size(),
request.getServiceConfigVersionNote());
+          serviceName, request.getGroupName(), request.getTag(), numHosts, request.getServiceConfigVersionNote());
 
       if (!request.getConfigs().isEmpty()) {
         List<String> affectedConfigTypeList = new ArrayList(request.getConfigs().keySet());


Mime
View raw message