-
Notifications
You must be signed in to change notification settings - Fork 14.2k
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
[AIRFLOW-4574] SSHHook private_key may only be supplied in extras #6163
[AIRFLOW-4574] SSHHook private_key may only be supplied in extras #6163
Conversation
* discussion on original PR suggested removing private_key option as init param * with this PR, can still provide through extras, but not as init param * also add support for private_key in tunnel -- missing in original PR for this issue * remove test related to private_key init param * use context manager to auto-close socket listener so tests can be re-run
Codecov Report
@@ Coverage Diff @@
## master #6163 +/- ##
=========================================
Coverage ? 80.06%
=========================================
Files ? 608
Lines ? 35030
Branches ? 0
=========================================
Hits ? 28046
Misses ? 6984
Partials ? 0
Continue to review full report at Codecov.
|
@mik-laj is this PR ok or should i split it up -- one to fix the oversight (missing tunnel support) and another to remove primary_key as |
args=["python", "-c", HELLO_SERVER_CMD], | ||
stdout=subprocess.PIPE, | ||
) | ||
with subprocess.Popen(**subprocess_kwargs) as server_handle, hook.create_tunnel(2135, 2134): |
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.
Nice!.
I am sorry that I missed this PR earlier. The patch looks good to me, but @ashb wants to look, so I'll wait for its review. In the next PR I would like to divide the cleaning changes in the tests from the changes in functionality. This made it easier to review the changes. |
no worries
will do next time thank you |
…ache#6163) * discussion on original PR suggested removing private_key option as init param * with this PR, can still provide through extras, but not as init param * also add support for private_key in tunnel -- missing in original PR for this issue * remove test related to private_key init param * use context manager to auto-close socket listener so tests can be re-run (cherry picked from commit 0790ede)
…ache#6163) * discussion on original PR suggested removing private_key option as init param * with this PR, can still provide through extras, but not as init param * also add support for private_key in tunnel -- missing in original PR for this issue * remove test related to private_key init param * use context manager to auto-close socket listener so tests can be re-run (cherry picked from commit 0790ede)
Summary:
Notes:
@mik-laj @pgagnon @kaxil
In this PR I attempt to address concerns raised by @pgagnon after the merge of original PR for this issue (#6104 ).
Namely, I set out to remove private_key as an init param to SSHHook.
While doing so, I noticed that original PR did not extend support for
private_key
to the get_tunnel hook method, because it doesn't useget_conn
but connects independently.This PR rectifies this oversight by adding this capability.
I did not create new jira because this feels like continuation of same issue -- just more completely fulfilling its goal, and hopefully in a way that everyone can be happy with.
There were some minor tweaks that I made to testing.
HELLO_SERVER_CMD
was not executed in context manager, so it left the socket listener running, which meant you could not rerun the tests without manually killing the listener process. I use context manager. I think this makes sense in same PR because it actively interfered with my ability to test my change.Make sure you have checked all steps below.
Jira
Description
Tests
Commits
Documentation