uranusjr commented on code in PR #23043:
URL: https://github.com/apache/airflow/pull/23043#discussion_r851669478


##########
airflow/providers/ssh/hooks/ssh.py:
##########
@@ -415,6 +415,9 @@ def _pkey_from_private_key(self, private_key: str, 
passphrase: Optional[str] = N
         :return: ``paramiko.PKey`` appropriate for given key
         :raises AirflowException: if key cannot be read
         """
+        if private_key.count("\n") < 2:

Review Comment:
   ```suggestion
           if private_key.split("\n", 2) < 2:
   ```
   
   Using `count()` here would unnecessarily scan the entire key. It feels wrong 
to waste time for that since valid values are expected (which usually contains 
many lines).



-- 
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]

Reply via email to