SOLR-5164, Can not create a collection via collections API (cloud mode). Fixes SOLR-5099 too

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1514666 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Erick Erickson 2013-08-16 12:01:06 +00:00
parent 51da0631c0
commit fd9ae25cd1
3 changed files with 6 additions and 3 deletions

View File

@ -130,6 +130,8 @@ Bug Fixes
of divide by zero, and makes estimated hit counts meaningful in non-optimized
indexes. (hossman)
* SOLR-5164: Can not create a collection via collections API (cloud mode) (Erick Erickson)
Optimizations
----------------------

View File

@ -31,7 +31,6 @@ import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.Writer;
import java.util.Date;
import java.util.List;
import java.util.Properties;
@ -78,6 +77,7 @@ public class CorePropertiesLocator implements CoresLocator {
Properties p = buildCoreProperties(cd);
Writer os = null;
try {
propfile.getParentFile().mkdirs();
os = new OutputStreamWriter(new FileOutputStream(propfile), Charsets.UTF_8);
p.store(os, "Written by CorePropertiesLocator");
}

View File

@ -409,8 +409,9 @@ public class CoreAdminHandler extends RequestHandlerBase {
String name = checkNotEmpty(params.get(CoreAdminParams.NAME),
"Missing parameter [" + CoreAdminParams.NAME + "]");
String instancedir = params.get(CoreAdminParams.INSTANCE_DIR);
if (StringUtils.isEmpty(instancedir))
instancedir = container.getSolrHome() + File.separator + name;
if (StringUtils.isEmpty(instancedir)) {
instancedir = name; // Already relative to solrHome, we haven't been given an absolute path.
}
Properties coreProps = new Properties();
for (String param : paramToProp.keySet()) {