Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
src/molecule/driver/delegated.py: Fix connection plugin name setting (#…
…3957) In ansible_connection_options(), when setting connection plugin name, the code does: for i in instance_params: if d.get(i[0], i[1]): conn_dict["ansible_" + i[0]] = d.get(i[0]) Looking at instance_params, for the connection, there's a default value neither None nor False, leading to the the being true and setting ansible_connection to d.get(i[0]), which may not be defined. In this case, this will lead to ansible_connection being set to None. This will lead to troubles. For instance, when using 'meta: reset_connection', ansible in _execute_meta() will call plugin_loader.connection_loader.get() with first param being None, leading to : ERROR! Unexpected Exception, this is probably a bug: 'NoneType' object has no attribute 'startswith' So, ensure that the default value is set when setting conn_dict. Fixes: 5b750ff ("Adds Support for Shell Type Instance Param to Delegated Driver") Signed-off-by: Arnaud Patard <[email protected]> Co-authored-by: Sorin Sbarnea <[email protected]>
- Loading branch information