You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by "DaanHoogland (via GitHub)" <gi...@apache.org> on 2023/07/25 09:55:05 UTC

[GitHub] [cloudstack] DaanHoogland commented on a diff in pull request #7769: AutoScaling: support userdata id and userdata details

DaanHoogland commented on code in PR #7769:
URL: https://github.com/apache/cloudstack/pull/7769#discussion_r1273282043


##########
api/src/main/java/org/apache/cloudstack/api/BaseCmd.java:
##########
@@ -456,4 +459,18 @@ public ApiCommandResourceType getApiResourceType() {
         return ApiCommandResourceType.None;
     }
 
+    public Map<String, String> convertDetailsToMap(Map details) {
+        Map<String, String> detailsMap = new HashMap<String, String>();
+        if (MapUtils.isNotEmpty(details)) {
+            Collection parameterCollection = details.values();
+            Iterator iter = parameterCollection.iterator();
+            while (iter.hasNext()) {
+                HashMap<String, String> value = (HashMap<String, String>)iter.next();
+                for (Map.Entry<String,String> entry: value.entrySet()) {
+                    detailsMap.put(entry.getKey(),entry.getValue());
+                }
+            }
+        }
+        return detailsMap;
+    }

Review Comment:
   Good refactor! This is happening so often. Did you replace all occurences?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org