dabla commented on code in PR #60651:
URL: https://github.com/apache/airflow/pull/60651#discussion_r2784108971
##########
providers/microsoft/winrm/src/airflow/providers/microsoft/winrm/hooks/winrm.py:
##########
@@ -191,47 +192,74 @@ 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}")
Review Comment:
I've checked the underlying WinRM implementation and it doesn't make sense
to do the validation in the WinRM as the Transport instantiated within the
Protocol already does that, so I'll remove this check as it is already checked
underneath and this makes the uses of other transport types impossible.
```
# validate credential requirements for various auth types
if self.auth_method != "kerberos":
if self.auth_method == "certificate" or (self.auth_method ==
"ssl" and (self.cert_pem or self.cert_key_pem)):
if not self.cert_pem or not self.cert_key_pem:
raise InvalidCredentialsError("both cert_pem and
cert_key_pem must be specified for cert auth")
if not os.path.exists(self.cert_pem):
raise InvalidCredentialsError("cert_pem file not found
(%s)" % self.cert_pem)
if not os.path.exists(self.cert_key_pem):
raise InvalidCredentialsError("cert_key_pem file not
found (%s)" % self.cert_key_pem)
else:
if not self.username:
raise InvalidCredentialsError("auth method %s requires a
username" % self.auth_method)
if self.password is None:
raise InvalidCredentialsError("auth method %s requires a
password" % self.auth_method)
```
--
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]