ephraimbuddy commented on code in PR #44976:
URL: https://github.com/apache/airflow/pull/44976#discussion_r1890415101
##########
airflow/dag_processing/bundles/git.py:
##########
@@ -68,18 +84,47 @@ def __init__(self, *, repo_url: str, tracking_ref: str,
subdir: str | None = Non
else:
self.refresh()
+ def init_bundle(self) -> None:
+ if self.ssh_conn_id:
+ try:
+ from airflow.providers.ssh.hooks.ssh import SSHHook
+ except ImportError as e:
+ raise AirflowOptionalProviderFeatureException(e)
+ ssh_hook = SSHHook(ssh_conn_id=self.ssh_conn_id)
+ ssh_hook.get_conn()
+ temp_key_file_path = None
+ try:
+ if not ssh_hook.key_file:
+ conn = ssh_hook.get_connection(self.ssh_conn_id)
+ private_key = conn.extra_dejson.get("private_key")
+ if not private_key:
+ raise AirflowException("No private key present in
connection")
+ with tempfile.NamedTemporaryFile(delete=False) as key_file:
Review Comment:
Fixed
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]