Replace empty index block checks with global block checks in get/put license actions (elastic/x-pack-elasticsearch#2766)
Related to elastic/x-pack-elasticsearch#10530 Original commit: elastic/x-pack-elasticsearch@f4c9924d62
This commit is contained in:
parent
4f65d9b527
commit
f416c5b3c9
|
@ -44,12 +44,12 @@ public class TransportGetLicenseAction extends TransportMasterNodeReadAction<Get
|
|||
|
||||
@Override
|
||||
protected ClusterBlockException checkBlock(GetLicenseRequest request, ClusterState state) {
|
||||
return state.blocks().indexBlockedException(ClusterBlockLevel.METADATA_READ, "");
|
||||
return state.blocks().globalBlockedException(ClusterBlockLevel.METADATA_READ);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void masterOperation(final GetLicenseRequest request, ClusterState state, final ActionListener<GetLicenseResponse>
|
||||
listener) throws ElasticsearchException {
|
||||
protected void masterOperation(final GetLicenseRequest request, ClusterState state,
|
||||
final ActionListener<GetLicenseResponse> listener) throws ElasticsearchException {
|
||||
listener.onResponse(new GetLicenseResponse(licenseService.getLicense()));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -44,7 +44,7 @@ public class TransportPutLicenseAction extends TransportMasterNodeAction<PutLice
|
|||
|
||||
@Override
|
||||
protected ClusterBlockException checkBlock(PutLicenseRequest request, ClusterState state) {
|
||||
return state.blocks().indexBlockedException(ClusterBlockLevel.METADATA_WRITE, "");
|
||||
return state.blocks().globalBlockedException(ClusterBlockLevel.METADATA_WRITE);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Reference in New Issue