incubator-cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From h...@apache.org
Subject [38/50] git commit: StaticRoleBasedAPIAccessChecker: Fix acl cfg processing error messages
Date Mon, 14 Jan 2013 16:15:58 GMT
StaticRoleBasedAPIAccessChecker: Fix acl cfg processing error messages

Signed-off-by: Rohit Yadav <bhaisaab@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/commit/4c80684b
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/tree/4c80684b
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/diff/4c80684b

Branch: refs/heads/cloud-agent-with-openvswitch
Commit: 4c80684b1fffb14cea8ffd3880b278bd51dff9fc
Parents: 83e7214
Author: Rohit Yadav <bhaisaab@apache.org>
Authored: Fri Jan 11 16:47:02 2013 -0800
Committer: Rohit Yadav <bhaisaab@apache.org>
Committed: Fri Jan 11 18:44:20 2013 -0800

----------------------------------------------------------------------
 .../acl/StaticRoleBasedAPIAccessChecker.java       |   14 ++++++--------
 1 files changed, 6 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/4c80684b/plugins/acl/static-role-based/src/org/apache/cloudstack/acl/StaticRoleBasedAPIAccessChecker.java
----------------------------------------------------------------------
diff --git a/plugins/acl/static-role-based/src/org/apache/cloudstack/acl/StaticRoleBasedAPIAccessChecker.java
b/plugins/acl/static-role-based/src/org/apache/cloudstack/acl/StaticRoleBasedAPIAccessChecker.java
index 740fbbc..380b671 100644
--- a/plugins/acl/static-role-based/src/org/apache/cloudstack/acl/StaticRoleBasedAPIAccessChecker.java
+++ b/plugins/acl/static-role-based/src/org/apache/cloudstack/acl/StaticRoleBasedAPIAccessChecker.java
@@ -43,9 +43,8 @@ public class StaticRoleBasedAPIAccessChecker extends AdapterBase implements
APIC
 
     protected StaticRoleBasedAPIAccessChecker() {
         super();
-        for (RoleType roleType: RoleType.values()) {
+        for (RoleType roleType: RoleType.values())
             s_roleBasedApisMap.put(roleType, new HashSet<String>());
-        }
     }
 
     @Override
@@ -71,16 +70,14 @@ public class StaticRoleBasedAPIAccessChecker extends AdapterBase implements
APIC
         List<PluggableService> services = locator.getAllPluggableServices();
         services.add((PluggableService) ComponentLocator.getComponent(ManagementServer.Name));
 
-        Map<String, String> configPropertiesMap = new HashMap<String, String>();
         for (PluggableService service : services) {
-            configPropertiesMap.putAll(service.getProperties());
+            processConfigFiles(service.getProperties(), service.getClass().toString());
+            s_logger.info("Processed role based acl for: " + service.toString());
         }
-
-        processConfigFiles(configPropertiesMap);
         return true;
     }
 
-    private void processConfigFiles(Map<String, String> configMap) {
+    private void processConfigFiles(Map<String, String> configMap, String service)
{
         for (Map.Entry<String, String> entry: configMap.entrySet()) {
             String apiName = entry.getKey();
             String roleMask = entry.getValue();
@@ -91,7 +88,8 @@ public class StaticRoleBasedAPIAccessChecker extends AdapterBase implements
APIC
                         s_roleBasedApisMap.get(roleType).add(apiName);
                 }
             } catch (NumberFormatException nfe) {
-                s_logger.info("Malformed commands.properties permissions value, for entry:
" + entry.toString());
+                s_logger.info("Malformed getProperties() value for service: " + service
+                        + " for entry: " + entry.toString());
             }
         }
     }


Mime
View raw message