You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by jb...@apache.org on 2016/11/17 05:52:28 UTC

[1/2] git commit: updated refs/heads/4.8 to 293ec4f

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 <wi...@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 <wi...@widodh.nl>
Authored: Thu Sep 15 12:18:21 2016 +0200
Committer: Wido den Hollander <wi...@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 = "";


[2/2] git commit: updated refs/heads/4.8 to 293ec4f

Posted by jb...@apache.org.
Merge pull request #1673 from wido/CLOUDSTACK-9071

CLOUDSTACK-9071: Properly parse stats.output.uri in StatsCollectorBoth 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.

* pr/1673:
  CLOUDSTACK-9071: Properly parse stats.output.uri in StatsCollector

Signed-off-by: John Burwell <me...@cockamamy.net>


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

Branch: refs/heads/4.8
Commit: 293ec4f3fc4b4cb6b238e34dce38770fc49f3aa2
Parents: b704cef c1997a1
Author: John Burwell <me...@cockamamy.net>
Authored: Thu Nov 17 00:45:21 2016 -0500
Committer: John Burwell <me...@cockamamy.net>
Committed: Thu Nov 17 00:45:21 2016 -0500

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