SOLR-12072: Invalid path string using ZkConfigManager.copyConfigDir(String fromConfig, String toConfig)

This commit is contained in:
Erick 2018-03-08 22:00:16 -08:00
parent dae572819b
commit 7dfb04ee5e
3 changed files with 11 additions and 1 deletions

View File

@ -261,6 +261,9 @@ Bug Fixes
in normalization instead of all. This bug normally doesn't matter since TextField doesn't call it. in normalization instead of all. This bug normally doesn't matter since TextField doesn't call it.
(Tim Allison via David Smiley) (Tim Allison via David Smiley)
* SOLR-12072: Invalid path string using ZkConfigManager.copyConfigDir(String fromConfig, String toConfig)
(Alessandro Hoss via Erick Erickson)
Optimizations Optimizations
---------------------- ----------------------

View File

@ -162,7 +162,7 @@ public class ZkConfigManager {
* @throws IOException if an I/O error occurs * @throws IOException if an I/O error occurs
*/ */
public void copyConfigDir(String fromConfig, String toConfig) throws IOException { public void copyConfigDir(String fromConfig, String toConfig) throws IOException {
copyConfigDir(CONFIGS_ZKNODE + "/" + fromConfig, CONFIGS_ZKNODE + "/" + toConfig, null); copyConfigDir(fromConfig, toConfig, null);
} }
/** /**

View File

@ -115,6 +115,13 @@ public class TestZkConfigManager extends SolrTestCaseJ4 {
// uploading same files to a new name creates a new config // uploading same files to a new name creates a new config
configManager.uploadConfigDir(tempConfig, "config2"); configManager.uploadConfigDir(tempConfig, "config2");
assertEquals(2, configManager.listConfigs().size()); assertEquals(2, configManager.listConfigs().size());
// Test copying a config works in both flavors
configManager.copyConfigDir("config2", "config2copy");
configManager.copyConfigDir("config2", "config2copy2", null);
configs = configManager.listConfigs();
assertTrue("config2copy should exist", configs.contains("config2copy"));
assertTrue("config2copy2 should exist", configs.contains("config2copy2"));
} }
} }