Skip to content

Commit

Permalink
[apache#5932] improve(CLI): Fix the CLI  delete the anonymous user
Browse files Browse the repository at this point in the history
Add error message to the CLI when delete the anonymous user.
  • Loading branch information
Abyss-lord committed Feb 10, 2025
1 parent a84fd18 commit a3f8a32
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
public class ErrorMessages {
public static final String CATALOG_EXISTS = "Catalog already exists.";
public static final String COLUMN_EXISTS = "Column already exists.";
public static final String DELETE_ANONYMOUS_USER =
"Can't delete anonymous user. This will cause unexpected " + "behavior.";
public static final String FILESET_EXISTS = "Fileset already exists.";
public static final String GROUP_EXISTS = "Group already exists.";
public static final String METALAKE_EXISTS = "Metalake already exists.";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@ public DeleteUser(
public void handle() {
boolean deleted = false;

if ("anonymous".equalsIgnoreCase(user)) {
exitWithError(ErrorMessages.DELETE_ANONYMOUS_USER);
}

if (!AreYouSure.really(force)) {
return;
}
Expand Down

0 comments on commit a3f8a32

Please sign in to comment.