ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jonathanhur...@apache.org
Subject [07/29] git commit: AMBARI-7306. Can't save notes for config groups. (mpapirkovskyy)
Date Wed, 17 Sep 2014 12:33:57 GMT
AMBARI-7306. Can't save notes for config groups. (mpapirkovskyy)


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

Branch: refs/heads/branch-alerts-dev
Commit: 56e022e554f6775c2bce683cb28d28b5744eec07
Parents: 6457726
Author: Myroslav Papirkovskyy <mpapyrkovskyy@hortonworks.com>
Authored: Mon Sep 15 19:33:02 2014 +0300
Committer: Myroslav Papirkovskyy <mpapyrkovskyy@hortonworks.com>
Committed: Tue Sep 16 18:07:16 2014 +0300

----------------------------------------------------------------------
 .../internal/ConfigGroupResourceProvider.java   | 20 ++++++++++++++++++--
 1 file changed, 18 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/56e022e5/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 6e13d9c..46e9016 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
@@ -211,6 +211,20 @@ public class ConfigGroupResourceProvider extends
     return getRequestStatus(null);
   }
 
+  @Override
+  public Set<String> checkPropertyIds(Set<String> propertyIds) {
+    //allow providing service_config_version_note, but we should not return it for config
group
+    Set<String> unsupportedPropertyIds = super.checkPropertyIds(propertyIds);
+    for (Iterator<String> iterator = unsupportedPropertyIds.iterator(); iterator.hasNext();
) {
+      String next = iterator.next();
+      next = PropertyHelper.getPropertyName(next);
+      if (next.equals("service_config_version_note") || next.equals("/service_config_version_note"))
{
+        iterator.remove();
+      }
+    }
+    return unsupportedPropertyIds;
+  }
+
   /**
    * Create configuration group resources based on set of config group requests.
    *
@@ -477,7 +491,8 @@ public class ConfigGroupResourceProvider extends
       configGroup.persist();
       cluster.addConfigGroup(configGroup);
       if (serviceName != null) {
-        cluster.createServiceConfigVersion(serviceName, getManagementController().getAuthName(),
null, configGroup);
+        cluster.createServiceConfigVersion(serviceName, getManagementController().getAuthName(),
+          request.getServiceConfigVersionNote(), configGroup);
       } else {
         LOG.warn("Could not determine service name for config group {}, service config version
not created",
             configGroup.getId());
@@ -569,7 +584,8 @@ public class ConfigGroupResourceProvider extends
 
       configGroup.persist();
       if (serviceName != null) {
-        cluster.createServiceConfigVersion(serviceName, getManagementController().getAuthName(),
null, configGroup);
+        cluster.createServiceConfigVersion(serviceName, getManagementController().getAuthName(),
+          request.getServiceConfigVersionNote(), configGroup);
       } else {
         LOG.warn("Could not determine service name for config group {}, service config version
not created",
             configGroup.getId());


Mime
View raw message