[KYUUBI #3887][FOLLOWUP] Fix kyuubiServerPrincipal logic in KyuubiCommands

### _Why are the changes needed?_

### _How was this patch tested?_
- [ ] Add some test cases that check the changes thoroughly including negative and positive cases if possible

- [ ] Add screenshots for manual tests if appropriate

- [ ] [Run test](https://kyuubi.readthedocs.io/en/master/develop_tools/testing.html#running-tests) locally before make a pull request

Closes #4764 from lightning-L/kyuubi-3887-followup.

Closes #3887

42a123282 [Tianlin Liao] [KYUUBI #3887][FOLLOWUP] fix kyuubiServerPrincipal logic in KyuubiCommands

Authored-by: Tianlin Liao <tiliao@ebay.com>
Signed-off-by: Cheng Pan <chengpan@apache.org>
This commit is contained in:
Tianlin Liao 2023-04-25 02:17:38 +08:00 committed by Cheng Pan
parent e1e57e5233
commit b0d07f7086
No known key found for this signature in database
GPG Key ID: 8001952629BCC75D

View File

@ -467,7 +467,7 @@ public class KyuubiCommands extends Commands {
beeLine.info("Connecting to " + url);
if (Utils.parsePropertyFromUrl(url, AUTH_PRINCIPAL) == null
|| Utils.parsePropertyFromUrl(url, AUTH_KYUUBI_SERVER_PRINCIPAL) == null) {
&& Utils.parsePropertyFromUrl(url, AUTH_KYUUBI_SERVER_PRINCIPAL) == null) {
String urlForPrompt = url.substring(0, url.contains(";") ? url.indexOf(';') : url.length());
if (username == null) {
username = beeLine.getConsoleReader().readLine("Enter username for " + urlForPrompt + ": ");