Github user neykov commented on a diff in the pull request:
https://github.com/apache/brooklyn-server/pull/208#discussion_r67842027
--- Diff:
software/base/src/main/java/org/apache/brooklyn/entity/software/base/AbstractSoftwareProcessSshDriver.java
---
@@ -344,9 +346,23 @@ public void runPostLaunchCommand() {
* @see SoftwareProcess#SHELL_ENVIRONMENT
*/
public Map<String, String> getShellEnvironment() {
- return
Strings.toStringMap(entity.getConfig(SoftwareProcess.SHELL_ENVIRONMENT), "");
+ Map<String, Object> env =
entity.getConfig(SoftwareProcess.SHELL_ENVIRONMENT);
+ if (env == null) {
+ return null;
+ }
+ ShellEnvironmentSerializer envSerializer = new
ShellEnvironmentSerializer(((EntityInternal)entity).getManagementContext());
+ Map<String, String> serializedEnv = Maps.newHashMap();
+ for (Entry<String, Object> entry : env.entrySet()) {
+ String key = serializeShellEnv(envSerializer, entry.getKey());
--- End diff --
That's to keep backwards compatibility. `Strings.toStringMap` would call
`toString` on the keys.
Using invalid keys will fail the task on the bash side. I'd like to avoid
validating the key here as depending on where you look you'll find different
definitions for a valid name.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---