Passing environment vars with "_" in the name doesn't work
Created by: Technobeats
Defining an environment variable with "_" in results in a stack trace.
WORKS
JAVAHOME=
environment_vars = {"JAVAHOME": "/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin"}
exec::Run(host=target, command="ant deploy >> {{ _logfile }} 2>&1", environment=environment_vars, cwd=self.installation_path)
ERROR
JAVA_HOME=
environment_vars = {"JAVA_HOME": "/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin"}
exec::Run(host=target, command="ant deploy >> {{ _logfile }} 2>&1", environment=environment_vars, cwd=self.installation_path
Traceback (most recent call last): File "/opt/inmanta/lib64/python3.6/site-packages/inmanta/agent/handler.py", line 534, in execute self.do_changes(ctx, resource, changes) File "/var/lib/inmanta/60442c77-e62e-4fab-badd-350eed94b6fc/agent/code/modules/inmanta_plugins.exec.py", line 167, in do_changes return self.do_cmd(ctx, resource, resource.command) File "/var/lib/inmanta/60442c77-e62e-4fab-badd-350eed94b6fc/agent/code/modules/inmanta_plugins.exec.py", line 140, in do_cmd raise Exception("Failed to execute command: %s" % ret[1]) Exception: Failed to execute command: