diff --git a/IM/ConfManager.py b/IM/ConfManager.py index 8c1ec6b8..36d7ed83 100644 --- a/IM/ConfManager.py +++ b/IM/ConfManager.py @@ -1498,7 +1498,7 @@ def configure_ansible(self, ssh, tmp_dir, ansible_version=None): if ansible_version_env: # restore original value os.environ['ANSIBLE_VERSION'] = ansible_version_env - else: + elif 'ANSIBLE_VERSION' in os.environ: del os.environ['ANSIBLE_VERSION'] if not success: