dabla commented on code in PR #60651:
URL: https://github.com/apache/airflow/pull/60651#discussion_r2749420209


##########
providers/microsoft/winrm/src/airflow/providers/microsoft/winrm/hooks/winrm.py:
##########
@@ -191,47 +192,69 @@ def get_conn(self):
         if not self.endpoint:
             self.endpoint = 
f"http://{self.remote_host}:{self.remote_port}/wsman";
 
+        if not self.password or not self.password.strip():
+            raise AirflowException(f"Missing password for WinRM connection to 
host: {self.remote_host}")
+
         try:
-            if self.password and self.password.strip():
-                self.winrm_protocol = Protocol(
-                    endpoint=self.endpoint,
-                    transport=self.transport,
-                    username=self.username,
-                    password=self.password,
-                    service=self.service,
-                    keytab=self.keytab,
-                    ca_trust_path=self.ca_trust_path,
-                    cert_pem=self.cert_pem,
-                    cert_key_pem=self.cert_key_pem,
-                    server_cert_validation=self.server_cert_validation,
-                    kerberos_delegation=self.kerberos_delegation,
-                    read_timeout_sec=self.read_timeout_sec,
-                    operation_timeout_sec=self.operation_timeout_sec,
-                    kerberos_hostname_override=self.kerberos_hostname_override,
-                    message_encryption=self.message_encryption,
-                    credssp_disable_tlsv1_2=self.credssp_disable_tlsv1_2,
-                    send_cbt=self.send_cbt,
+            winrm_protocol = Protocol(
+                endpoint=self.endpoint,
+                transport=self.transport,  # type: ignore
+                username=self.username,
+                password=self.password,
+                service=self.service,
+                keytab=self.keytab,  # type: ignore

Review Comment:
   Apparently, those are literals in the constructor of the winrm lib, dunno if 
we can do something about it, also I didn't change the parameters there so 
wondering why suddenly it's failing mypy.



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