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:
Tanguy Leroux 2017-10-31 16:15:14 +01:00 committed by GitHub
parent 4f65d9b527
commit f416c5b3c9
2 changed files with 4 additions and 4 deletions

View File

@ -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()));
}
}

View File

@ -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