fix: ensure connection plugin installed and env. var. set correctly#233
Merged
richm merged 1 commit intolinux-system-roles:mainfrom Mar 13, 2026
Merged
fix: ensure connection plugin installed and env. var. set correctly#233richm merged 1 commit intolinux-system-roles:mainfrom
richm merged 1 commit intolinux-system-roles:mainfrom
Conversation
The previous commit broke the logic for setting up connection plugin. * The connection plugin should always be installed - there is no reason to skip * Ensure the connection plugin is installed in a path in ANSIBLE_CONNECTION_PLUGINS * Ensure ANSIBLE_CONNECTION_PLUGINS is set correctly always * Ensure that the connection_plugins is installed in the local .tox/connection_plugins if not already in ANSIBLE_CONNECTION_PLUGINS * Ensure that the local .tox/connection_plugins is in ANSIBLE_CONNECTION_PLUGINS if not already * Refactor the code by creating a separate function for setup_connection_plugin And clean up some other debugging code Signed-off-by: Rich Megginson <rmeggins@redhat.com>
Reviewer's GuideRefactors the container test script to always install and correctly wire up Ansible callback and connection plugins, ensuring ANSIBLE_CONNECTION_PLUGINS is consistently set and that a local .tox/connection_plugins directory is used as needed, while tightening debug logging behavior and removing the ability to skip plugin setup. File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- In
setup_connection_plugin, whenANSIBLE_CONNECTION_PLUGINSis empty or contains leading/trailing:separators,read -rawill produce empty path elements that are then preserved innew_con_plugin_paths; consider explicitly filtering out emptycon_plugin_pathentries to avoid unintentionally adding the current directory or empty segments to the search path. - The use of
local -aand array operations insetup_connection_pluginassumes a Bash-compatible shell; if this script may be run under a more limited/bin/sh, it would be safer to either enforce a Bash shebang or avoid Bash-specific array syntax.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- In `setup_connection_plugin`, when `ANSIBLE_CONNECTION_PLUGINS` is empty or contains leading/trailing `:` separators, `read -ra` will produce empty path elements that are then preserved in `new_con_plugin_paths`; consider explicitly filtering out empty `con_plugin_path` entries to avoid unintentionally adding the current directory or empty segments to the search path.
- The use of `local -a` and array operations in `setup_connection_plugin` assumes a Bash-compatible shell; if this script may be run under a more limited `/bin/sh`, it would be safer to either enforce a Bash shebang or avoid Bash-specific array syntax.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The previous commit broke the logic for setting up connection plugin.
already in ANSIBLE_CONNECTION_PLUGINS
already
And clean up some other debugging code
Signed-off-by: Rich Megginson rmeggins@redhat.com
Summary by Sourcery
Ensure Ansible connection plugins are always installed and configured correctly in the test container script.
Bug Fixes:
Enhancements: