modules/common/cassandra-installer/src/main/java/org/rhq/cassandra/installer/CassandraInstaller.java | 33 +++++++--- modules/enterprise/server/ear/pom.xml | 5 + 2 files changed, 29 insertions(+), 9 deletions(-)
New commits: commit 7ca4e46c88998511802c8ced6e2134420a20e5ff Author: John Sanda jsanda@redhat.com Date: Fri Mar 22 14:08:55 2013 -0400
include cassandra plugin in ear and make installer dir checking more robust
diff --git a/modules/common/cassandra-installer/src/main/java/org/rhq/cassandra/installer/CassandraInstaller.java b/modules/common/cassandra-installer/src/main/java/org/rhq/cassandra/installer/CassandraInstaller.java index fe0ebff..7c75fb5 100644 --- a/modules/common/cassandra-installer/src/main/java/org/rhq/cassandra/installer/CassandraInstaller.java +++ b/modules/common/cassandra-installer/src/main/java/org/rhq/cassandra/installer/CassandraInstaller.java @@ -198,9 +198,13 @@ public class CassandraInstaller { String seeds = hostname; deploymentOptions.setSeeds(seeds);
- deploymentOptions.setCommitLogDir(cmdLine.getOptionValue("commitlog", commitLogDir)); - deploymentOptions.setDataDir(cmdLine.getOptionValue("data", dataDir)); - deploymentOptions.setSavedCachesDir(cmdLine.getOptionValue("saved-caches", savedCachesDir)); + commitLogDir = cmdLine.getOptionValue("commitlog", commitLogDir); + dataDir = cmdLine.getOptionValue("data", dataDir); + savedCachesDir = cmdLine.getOptionValue("saved-caches", savedCachesDir); + + deploymentOptions.setCommitLogDir(cmdLine.getOptionValue(commitLogDir)); + deploymentOptions.setDataDir(dataDir); + deploymentOptions.setSavedCachesDir(savedCachesDir); deploymentOptions.setLogDir(logDir.getAbsolutePath()); deploymentOptions.setLoggingLevel("INFO"); deploymentOptions.setRpcPort(rpcPort); @@ -257,15 +261,26 @@ public class CassandraInstaller { private void checkPerms(Option option, String path) { File dir = new File(path);
- if (!dir.isDirectory()) { - log.warn(path + " is not a directory. Use the --" + option.getLongOpt() + " to change this value."); + if (dir.exists()) { + if (dir.isFile()) { + log.warn(path + " is not a directory. Use the --" + option.getLongOpt() + " to change this value."); + } + } else { + File parent = findParentDir(new File(path)); + if (!parent.canWrite()) { + log.warn("The user running this installer does not appear to have write permissions to " + parent + + ". Either make sure that the user running the storage node has write permissions or use the --" + + option.getLongOpt() + " to change this value."); + } } + }
- if (!dir.canWrite()) { - log.warn("The user running this installer does not appear to have write permissions to " + path + - ". Either make sure that the user running the storage node has write permissions or use the --" + - option.getLongOpt() + " to change this value."); + private File findParentDir(File path) { + File dir = path; + while (!dir.exists()) { + dir = dir.getParentFile(); } + return dir; }
private PropertiesFileUpdate getServerProperties() { diff --git a/modules/enterprise/server/ear/pom.xml b/modules/enterprise/server/ear/pom.xml index d6a38d8..a02c12e 100644 --- a/modules/enterprise/server/ear/pom.xml +++ b/modules/enterprise/server/ear/pom.xml @@ -405,6 +405,11 @@ <artifactId>rhq-filetemplate-bundle-plugin</artifactId> <version>${project.version}</version> </artifactItem> + <artifactItem> + <groupId>${project.groupId}</groupId> + <artifactId>rhq-cassandra-plugin</artifactId> + <version>${project.version}</version> + </artifactItem> </artifactItems> <outputDirectory>${earDirectory}/rhq-downloads/rhq-plugins</outputDirectory> </configuration>
rhq-commits@lists.fedorahosted.org