Skip to content

Commit

Permalink
Merge pull request payara#3267 from smillidge/PAYARA-3166
Browse files Browse the repository at this point in the history
PAYARA-3166 Prevent showing of spurious error on command replication
  • Loading branch information
arjantijms authored and MeroRai committed Nov 15, 2018
1 parent a7da356 commit 3a6380c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@
import java.beans.PropertyVetoException;
import java.io.File;
import org.glassfish.api.admin.*;
import org.glassfish.config.support.CommandTarget;
import org.glassfish.config.support.TargetType;
import org.jvnet.hk2.config.ConfigSupport;
import org.jvnet.hk2.config.SingleConfigCode;
Expand Down Expand Up @@ -149,6 +148,9 @@ public class CreateFileUser implements /*UndoableCommand*/ AdminCommand, AdminCo
public boolean preAuthorization(AdminCommandContext context) {
config = CLIUtil.chooseConfig(domain, target, context.getActionReport());
if (config == null) {
// command is executed on all instances and remote instances may not have the config
// however this is to be expected so do not show spurious error.
context.getActionReport().setActionExitCode(ActionReport.ExitCode.SUCCESS);
return false;
}
securityService = config.getSecurityService();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,8 @@ public class DeleteFileUser implements /*UndoableCommand*/ AdminCommand, AdminCo
public boolean preAuthorization(AdminCommandContext context) {
config = CLIUtil.chooseConfig(domain, target, context.getActionReport());
if (config == null) {
// config can be null as this command executes on all instances
context.getActionReport().setActionExitCode(ActionReport.ExitCode.SUCCESS);
return false;
}
securityService = config.getSecurityService();
Expand Down

0 comments on commit 3a6380c

Please sign in to comment.