diff --git a/CHANGELOG.md b/CHANGELOG.md index d3798d38ca..98eba066cf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ Changes in this release: - added influxdb reporter for protocol endpoint metrics - Remove the configuration option agent-run-at-start (#1055) - Add project id and environment id as optional parameters to API call (#1001) +- Fixed an issue which cleared the environment on remote python 2 interpreters v 2019.1 (2019-03-06) Changes in this release: @@ -37,8 +38,8 @@ DEPRECATIONS: - Minimal python version is now python 3.6 - Removal of snapshot and restore functionality from the server (#789) - Removed the non-version api (#526) -- The config option agent-interval, agent-splay, autostart_agent_interval and autostart_splay are -deprecated in favour of agent-deploy-interval, agent-deploy-splay-time, autostart_agent_deploy_interval +- The config option agent-interval, agent-splay, autostart_agent_interval and autostart_splay are +deprecated in favour of agent-deploy-interval, agent-deploy-splay-time, autostart_agent_deploy_interval and autostart_agent_deploy_splay_time respectively. The deprecated options will be removed in release 2019.2 v 2018.3 (2018-12-07) diff --git a/src/inmanta/agent/io/local.py b/src/inmanta/agent/io/local.py index 036d0907a8..20defff060 100644 --- a/src/inmanta/agent/io/local.py +++ b/src/inmanta/agent/io/local.py @@ -397,9 +397,11 @@ def run(self, command, arguments=[], env=None, cwd=None, timeout=None): if env is not None: current_env.update(env) if sys.version_info < (3, 0, 0): - current_env = {} + # python < 2.7 does not support dict comprehensions + new_env = {} for k, v in current_env.items(): - current_env[k.encode()] = str(v).encode() + new_env[k.encode()] = str(v).encode() + current_env = new_env cmds = [command] + arguments result = subprocess.Popen(cmds, stdout=subprocess.PIPE, stderr=subprocess.PIPE, env=current_env, cwd=cwd)