From d6509f0a2173b5fe0206b9b578839715775be2c3 Mon Sep 17 00:00:00 2001 From: Pearl Dsilva Date: Thu, 18 Feb 2021 14:37:20 +0530 Subject: [PATCH 1/2] API discovery: Prevent overwrite of API parameters in case the API names are the same (#4609) Co-authored-by: Pearl Dsilva --- .../apache/cloudstack/discovery/ApiDiscoveryServiceImpl.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/api/discovery/src/main/java/org/apache/cloudstack/discovery/ApiDiscoveryServiceImpl.java b/plugins/api/discovery/src/main/java/org/apache/cloudstack/discovery/ApiDiscoveryServiceImpl.java index c16d1b23324..5d2285629d6 100644 --- a/plugins/api/discovery/src/main/java/org/apache/cloudstack/discovery/ApiDiscoveryServiceImpl.java +++ b/plugins/api/discovery/src/main/java/org/apache/cloudstack/discovery/ApiDiscoveryServiceImpl.java @@ -20,6 +20,7 @@ import java.lang.reflect.Field; import java.util.ArrayList; import java.util.HashMap; import java.util.HashSet; +import java.util.LinkedHashSet; import java.util.List; import java.util.Map; import java.util.Set; @@ -67,7 +68,7 @@ public class ApiDiscoveryServiceImpl extends ComponentLifecycleBase implements A if (s_apiNameDiscoveryResponseMap == null) { long startTime = System.nanoTime(); s_apiNameDiscoveryResponseMap = new HashMap(); - Set> cmdClasses = new HashSet>(); + Set> cmdClasses = new LinkedHashSet>(); for (PluggableService service : _services) { s_logger.debug(String.format("getting api commands of service: %s", service.getClass().getName())); cmdClasses.addAll(service.getCommands()); From aab24476568da20ded1bf010189805c0d4e6b834 Mon Sep 17 00:00:00 2001 From: dahn Date: Thu, 18 Feb 2021 12:48:16 +0000 Subject: [PATCH 2/2] systemvm: loop optimisation in bash (#4451) Co-authored-by: Daan Hoogland --- systemvm/debian/opt/cloud/bin/vr_cfg.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/systemvm/debian/opt/cloud/bin/vr_cfg.sh b/systemvm/debian/opt/cloud/bin/vr_cfg.sh index 619ec5c4483..8447947bd3b 100755 --- a/systemvm/debian/opt/cloud/bin/vr_cfg.sh +++ b/systemvm/debian/opt/cloud/bin/vr_cfg.sh @@ -33,7 +33,7 @@ while getopts 'c:' OPTION; do esac; done export DEFER_CONFIG=true -while read line; do +cat $cfg | while read line; do #comment if [[ $line == \#* ]]; then continue @@ -74,7 +74,7 @@ while read line; do fi -done < $cfg +done # archive the configuration file mv $cfg /var/cache/cloud/processed/