justinmclean commented on code in PR #5988:
URL: https://github.com/apache/gravitino/pull/5988#discussion_r1897490349
##########
clients/cli/src/main/java/org/apache/gravitino/cli/GravitinoCommandLine.java:
##########
@@ -733,17 +733,26 @@ protected void handleRoleCommand() {
String userName = line.getOptionValue(GravitinoOptions.LOGIN);
FullName name = new FullName(line);
String metalake = name.getMetalakeName();
- String role = line.getOptionValue(GravitinoOptions.ROLE);
String[] privileges = line.getOptionValues(GravitinoOptions.PRIVILEGE);
Command.setAuthenticationMode(auth, userName);
+ String[] roles = line.getOptionValues(GravitinoOptions.ROLE);
+ if (roles == null && !CommandActions.LIST.equals(command)) {
+ System.err.println(ErrorMessages.MISSING_ROLE);
+ Main.exit(-1);
+ }
Review Comment:
I don;t this code will never be run, if an option exists it can never be
null as the CLI library catches this error.
##########
clients/cli/src/main/java/org/apache/gravitino/cli/GravitinoCommandLine.java:
##########
@@ -733,17 +733,26 @@ protected void handleRoleCommand() {
String userName = line.getOptionValue(GravitinoOptions.LOGIN);
FullName name = new FullName(line);
String metalake = name.getMetalakeName();
- String role = line.getOptionValue(GravitinoOptions.ROLE);
String[] privileges = line.getOptionValues(GravitinoOptions.PRIVILEGE);
Command.setAuthenticationMode(auth, userName);
+ String[] roles = line.getOptionValues(GravitinoOptions.ROLE);
+ if (roles == null && !CommandActions.LIST.equals(command)) {
+ System.err.println(ErrorMessages.MISSING_ROLE);
+ Main.exit(-1);
+ }
Review Comment:
I don't this code will never be run, if an option exists it can never be
null as the CLI library catches this error.
--
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]