cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jburw...@apache.org
Subject [1/2] git commit: updated refs/heads/4.8 to 293ec4f
Date Thu, 17 Nov 2016 05:52:28 GMT
Repository: cloudstack
Updated Branches:
  refs/heads/4.8 b704cefc1 -> 293ec4f3f


CLOUDSTACK-9071: Properly parse stats.output.uri in StatsCollector

Both host and path could have been NULL which causes the StatsCollector
no to start properly.

By checking if the Strings are not Empty or Null we make sure the StatsCollector
always runs and does not prevent the Management Server from starting.

Signed-off-by: Wido den Hollander <wido@widodh.nl>

Conflicts:
	server/src/com/cloud/server/StatsCollector.java


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

Branch: refs/heads/4.8
Commit: c1997a1705278d4ba39d64102e7ce76894f1e30d
Parents: 9eb8b2e
Author: Wido den Hollander <wido@widodh.nl>
Authored: Thu Sep 15 12:18:21 2016 +0200
Committer: Wido den Hollander <wido@widodh.nl>
Committed: Thu Sep 29 16:00:38 2016 +0200

----------------------------------------------------------------------
 server/src/com/cloud/server/StatsCollector.java | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c1997a17/server/src/com/cloud/server/StatsCollector.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/server/StatsCollector.java b/server/src/com/cloud/server/StatsCollector.java
index ca86cfd..ee9e41d 100644
--- a/server/src/com/cloud/server/StatsCollector.java
+++ b/server/src/com/cloud/server/StatsCollector.java
@@ -34,6 +34,7 @@ import java.util.concurrent.TimeUnit;
 import javax.inject.Inject;
 
 import org.apache.cloudstack.utils.usage.UsageUtils;
+import org.apache.commons.lang.StringUtils;
 import org.apache.log4j.Logger;
 import org.springframework.stereotype.Component;
 
@@ -271,12 +272,18 @@ public class StatsCollector extends ManagerBase implements ComponentMethodInterc
                     s_logger.info(scheme + " is not a valid protocol for external statistics.
No statistics will be send.");
                 }
 
-                externalStatsHost = uri.getHost();
+                if (!StringUtils.isEmpty(uri.getHost())) {
+                    externalStatsHost = uri.getHost();
+                }
+
                 externalStatsPort = uri.getPort();
-                externalStatsPrefix = uri.getPath().substring(1);
+
+                if (!StringUtils.isEmpty(uri.getPath())) {
+                    externalStatsPrefix = uri.getPath().substring(1);
+                }
 
                 /* Append a dot (.) to the prefix if it is set */
-                if (externalStatsPrefix != null && !externalStatsPrefix.equals(""))
{
+                if (!StringUtils.isEmpty(externalStatsPrefix)) {
                     externalStatsPrefix += ".";
                 } else {
                     externalStatsPrefix = "";


Mime
View raw message