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
fix git wrapper #29069
fix git wrapper #29069
Conversation
cc @abadger |
@plamer ping, are you able to test this? I'd like to see this go into 2.4.0 for which rc1 has already gone out. So we're closing in on the time when we'd have to punt this to a later release. |
os.environ["GIT_SSH"] = ssh_wrapper | ||
# using shell to avoid 'noexec' issues if module temp dir is located in such a mount | ||
os.environ["GIT_SSH_COMMAND"] = ' '.join([os.environ.get('SHELL', '/bin/sh'), ssh_wrapper]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The join
here seems a little unnecessary, and the performance is worse than a printf like string format or using .format
Although it is just 1 line, and not repeated, so that's just a little bit of a nitpick.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated to use percent formatting
@@ -371,9 +371,10 @@ def write_ssh_wrapper(): | |||
|
|||
def set_git_ssh(ssh_wrapper, key_file, ssh_opts): | |||
|
|||
if os.environ.get("GIT_SSH"): | |||
del os.environ["GIT_SSH"] | |||
# git_ssh_command will override git_ssh, so only older git needs it |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As far as I see GIT_SSH_COMMAND
was only introduced in git 2.3, so this change will not fix the issue on many systems, including rhel7.
* fix git wrapper * fallback to bin/sh * Use percent formatting as per sivel's review
This reverts commit f8005d2. fix needs to be rethought as it applies to only newer git versions and use of env shell breaks with non 'bourne compatible' shells
This reverts commit f8005d2. fix needs to be rethought as it applies to only newer git versions and use of env shell breaks with non 'bourne compatible' shells
* fix git wrapper * fallback to bin/sh * Use percent formatting as per sivel's review
SUMMARY
Fixes issue with git on noexec when forced to use the ssh wrapper it can write on demand.
ISSUE TYPE
COMPONENT NAME
git
ANSIBLE VERSION