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
Use _remote_is_local=True for local connection in synchronize #40833
Conversation
Due to the Effectively, we only need to bypass using |
Example of failures: https://app.shippable.com/github/ansible/ansible/runs/67719/34/tests |
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.
+1 either way
@@ -246,3 +250,15 @@ def test_delegate_remote_su(self): | |||
# delegate to other remote host with su enabled | |||
x = SynchronizeTester() | |||
x.runtest(fixturepath=os.path.join(self.fixturedir, 'delegate_remote_su')) | |||
|
|||
@patch.object(ActionModule, '_low_level_execute_command', side_effect=BreakPoint) |
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.
Looks like it works fine, but the side_effect=BreakPoint
here seems superfluous. Am I missing something?
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.
... or is that just to get it to bail out on that call?
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.
I'm short circuiting the execution of run
by setting a side_effect
on a function call that will actually connect to the server to expand the path. Otherwise it will try and go further, actually executing the module.
This allows me to kill execution immediately after what we are wanting to inspect.
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.
... or is that just to get it to bail out on that call?
Exactly that.
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.
Cool
rebuild_merge |
unrelated transient CI failure - merging |
…e#40833) * All instances of local connection should use _remote_is_local=True. Fixes ansible#40551 * Switch to instance attribute for synchronize * Add test that shows that synchronize _remote_is_local addresses tmpdir building (cherry picked from commit ad7ba91)
…e#40833) * All instances of local connection should use _remote_is_local=True. Fixes ansible#40551 * Switch to instance attribute for synchronize * Add test that shows that synchronize _remote_is_local addresses tmpdir building (cherry picked from commit ad7ba91)
* Use _remote_is_local=True for local connection in synchronize (#40833) * All instances of local connection should use _remote_is_local=True. Fixes #40551 * Switch to instance attribute for synchronize * Add test that shows that synchronize _remote_is_local addresses tmpdir building (cherry picked from commit ad7ba91) * Add changelog entry for #40833
* Use _remote_is_local=True for local connection in synchronize (#40833) * All instances of local connection should use _remote_is_local=True. Fixes #40551 * Switch to instance attribute for synchronize * Add test that shows that synchronize _remote_is_local addresses tmpdir building (cherry picked from commit ad7ba91) * Add changelog entry for #40833
…e#40833) * All instances of local connection should use _remote_is_local=True. Fixes ansible#40551 * Switch to instance attribute for synchronize * Add test that shows that synchronize _remote_is_local addresses tmpdir building
SUMMARY
All instances of local connection should use _remote_is_local=True. Fixes #40551
ISSUE TYPE
COMPONENT NAME
lib/ansible/plugins/connection/local.py
ANSIBLE VERSION
ADDITIONAL INFORMATION