Skip to content

Commit

Permalink
Fix bug with passed PATH in environment
Browse files Browse the repository at this point in the history
Since we're now passing the environment in, we also have to pass
the PATH. Might want to write up a system test for this type of
thing in the future.
  • Loading branch information
Jitsusama committed Jul 21, 2017
1 parent 3cbe974 commit 83cca81
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
5 changes: 4 additions & 1 deletion lets_do_dns/acme_dns_auth/authenticate.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,10 @@ def _delete_resource(self):
def _run_post_cmd(self):
if self._env.post_cmd:
run(self._env.post_cmd,
env={'CERTBOT_HOSTNAME': self._env.fqdn})
env={'CERTBOT_HOSTNAME': self._env.fqdn,
'PATH': ["/bin", "/sbin",
"/usr/bin", "/usr/sbin",
"/usr/local/bin", "/usr/local/sbin"]})

def _create_resource(self):
self._resource.create()
Expand Down
6 changes: 5 additions & 1 deletion tests/unit/acme_dns_auth/authenticate/test_cleanup_stage.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,4 +73,8 @@ def test_passes_postcmd_to_run(mocker, fqdn):
authentication.perform()

mock_run.assert_called_once_with(
'test-program --help', env={'CERTBOT_HOSTNAME': fqdn})
'test-program --help',
env={'CERTBOT_HOSTNAME': fqdn,
'PATH': ["/bin", "/sbin",
"/usr/bin", "/usr/sbin",
"/usr/local/bin", "/usr/local/sbin"]})

0 comments on commit 83cca81

Please sign in to comment.