Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure cwd is passed to utils.run_command() in all cases #3313

Merged
merged 1 commit into from
Nov 25, 2021
Merged

Ensure cwd is passed to utils.run_command() in all cases #3313

merged 1 commit into from
Nov 25, 2021

Commits on Nov 24, 2021

  1. Use cwd from BakedCommand in utils.run_command()

    Fixes #151.
    
    When trying to access Ansible vars in testinfra tests, the following
    function call would fail to get values coming from host/group vars:
    
        ansible_vars = host.ansible('debug', 'msg={{ hostvars[inventory_hostname] }}')
    
    This was due to: 1. testinfra being executed into the directory where
    molecule was launched instead of the scenario directory ; 2. group_vars
    being located in the scenario directory.
    
    This fix set the cwd passed to subprocess_tee to the cwd set in
    BakedCommand and fixes the issue.
    
    Signed-off-by: Albin Kerouanton <albinker@gmail.com>
    akerouanton committed Nov 24, 2021
    Configuration menu
    Copy the full SHA
    17ccc40 View commit details
    Browse the repository at this point in the history