modules/plugins/cassandra/src/main/java/org/rhq/plugins/cassandra/CassandraNodeDiscoveryComponent.java
| 11 ++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
New commits:
commit 3e842c8937bf2ac6483e344ec002ad839bd3cca1
Author: Stefan Negrea <snegrea(a)redhat.com>
Date: Wed May 1 16:47:22 2013 -0500
If the conf folder is absolute then do not base it on CWD. This can happen depending
how Cassandra deamon gets started.
diff --git
a/modules/plugins/cassandra/src/main/java/org/rhq/plugins/cassandra/CassandraNodeDiscoveryComponent.java
b/modules/plugins/cassandra/src/main/java/org/rhq/plugins/cassandra/CassandraNodeDiscoveryComponent.java
index cda0fe5..0ef6a0d 100644
---
a/modules/plugins/cassandra/src/main/java/org/rhq/plugins/cassandra/CassandraNodeDiscoveryComponent.java
+++
b/modules/plugins/cassandra/src/main/java/org/rhq/plugins/cassandra/CassandraNodeDiscoveryComponent.java
@@ -101,18 +101,21 @@ public class CassandraNodeDiscoveryComponent extends
JMXDiscoveryComponent {
if (classpathIndex != -1 && classpathIndex + 1 < arguments.length) {
String[] classpathEntries = arguments[classpathIndex +
1].split(":");
- String yamlConfigurationPath = null;
+ File yamlConfigurationPath = null;
for (String classpathEntry : classpathEntries) {
if (classpathEntry.endsWith("conf")) {
- yamlConfigurationPath = processInfo.getExecutable().getCwd() +
"/" + classpathEntry;
+ yamlConfigurationPath = new File(classpathEntry);
+ if (!yamlConfigurationPath.isAbsolute()) {
+ //relative path, use process CWD to find absolute path of the
conf directory
+ yamlConfigurationPath = new
File(processInfo.getExecutable().getCwd(), classpathEntry);
+ }
}
}
if (yamlConfigurationPath != null) {
-
InputStream inputStream = null;
try {
- File yamlConfigurationFile = new File(yamlConfigurationPath +
"/cassandra.yaml");
+ File yamlConfigurationFile = new File(yamlConfigurationPath,
"cassandra.yaml");
pluginConfig.put(new PropertySimple("yamlConfiguration",
yamlConfigurationFile.getAbsolutePath()));
inputStream = new FileInputStream(yamlConfigurationFile);
Show replies by date