|
39 | 39 | * (cmd.exe on Windows) and may not include any closing parentheses.<p> |
40 | 40 | * |
41 | 41 | * The shell command will be run with an environment set up to contain |
42 | | - * all of the current Hadoop configuration variables, with the '_' character |
43 | | - * replacing any '.' characters in the configuration keys.<p> |
| 42 | + * all of the current Hadoop configuration variables, with the '_' character |
| 43 | + * replacing any '.' or '-' characters in the configuration keys.<p> |
44 | 44 | * |
45 | 45 | * If the shell command returns an exit code of 0, the fencing is |
46 | 46 | * determined to be successful. If it returns any other exit code, the |
@@ -202,7 +202,7 @@ private static String tryGetPid(Process p) { |
202 | 202 |
|
203 | 203 | /** |
204 | 204 | * Set the environment of the subprocess to be the Configuration, |
205 | | - * with '.'s replaced by '_'s. |
| 205 | + * with '.'s and '-'s replaced by '_'s. |
206 | 206 | */ |
207 | 207 | private void setConfAsEnvVars(Map<String, String> env) { |
208 | 208 | for (Map.Entry<String, String> pair : getConf()) { |
@@ -237,7 +237,7 @@ private void addTargetInfoAsEnvVars(HAServiceTarget target, |
237 | 237 | for (Map.Entry<String, String> e : |
238 | 238 | target.getFencingParameters().entrySet()) { |
239 | 239 | String key = prefix + e.getKey(); |
240 | | - key = key.replace('.', '_'); |
| 240 | + key = key.replaceAll("[.-]", "_"); |
241 | 241 | environment.put(key, e.getValue()); |
242 | 242 | } |
243 | 243 | } |
|
0 commit comments