Skip to content

Commit

Permalink
Merge pull request #14136 from jasondlee/WFLY-11933
Browse files Browse the repository at this point in the history
[WFLY-11933] Return properly configured ModelNode when RBAC is enabled
  • Loading branch information
bstansberry committed Mar 20, 2021
2 parents b48ecac + a48db60 commit 30751ed
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,19 @@
import org.jboss.as.controller.PathAddress;
import org.jboss.as.controller.descriptions.ModelDescriptionConstants;
import org.jboss.dmr.ModelNode;
import org.jboss.dmr.ModelType;

public class WildFlyMetric implements Metric {

private static final ModelNode UNDEFINED = new ModelNode();

private LocalModelControllerClient modelControllerClient;
private final PathAddress address;
private final String attributeName;

static {
UNDEFINED.protect();
}

public WildFlyMetric(LocalModelControllerClient modelControllerClient, PathAddress address, String attributeName) {
this.modelControllerClient = modelControllerClient;
this.address = address;
Expand Down Expand Up @@ -79,7 +84,7 @@ private ModelNode readAttributeValue(PathAddress address, String attributeName)
} else{
LOGGER.unableToReadAttribute(attributeName, address, error);
}
return new ModelNode(ModelType.UNDEFINED);
return UNDEFINED;
}
return response.get(RESULT);
}
Expand Down

0 comments on commit 30751ed

Please sign in to comment.