Fix handling of the local flag on get licenses request
Original commit: elastic/x-pack-elasticsearch@4273827728
This commit is contained in:
parent
9947dab389
commit
4d1b4ccdec
|
@ -27,12 +27,12 @@ public class GetLicenseRequest extends MasterNodeReadOperationRequest<GetLicense
|
||||||
@Override
|
@Override
|
||||||
public void readFrom(StreamInput in) throws IOException {
|
public void readFrom(StreamInput in) throws IOException {
|
||||||
super.readFrom(in);
|
super.readFrom(in);
|
||||||
readLocal(in, Version.V_1_0_0_RC2);
|
readLocal(in);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void writeTo(StreamOutput out) throws IOException {
|
public void writeTo(StreamOutput out) throws IOException {
|
||||||
super.writeTo(out);
|
super.writeTo(out);
|
||||||
writeLocal(out, Version.V_1_0_0_RC2);
|
writeLocal(out);
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -38,7 +38,7 @@ public class TransportPutLicenseAction extends TransportMasterNodeOperationActio
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected String executor() {
|
protected String executor() {
|
||||||
return ThreadPool.Names.SAME;
|
return ThreadPool.Names.MANAGEMENT;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -59,7 +59,9 @@ public class RestGetLicenseAction extends BaseRestHandler {
|
||||||
public void handleRequest(final RestRequest request, final RestChannel channel, final Client client) {
|
public void handleRequest(final RestRequest request, final RestChannel channel, final Client client) {
|
||||||
final Map<String, String> overrideParams = ImmutableMap.of(ESLicenses.OMIT_SIGNATURE, "true");
|
final Map<String, String> overrideParams = ImmutableMap.of(ESLicenses.OMIT_SIGNATURE, "true");
|
||||||
final ToXContent.Params params = new ToXContent.DelegatingMapParams(overrideParams, request);
|
final ToXContent.Params params = new ToXContent.DelegatingMapParams(overrideParams, request);
|
||||||
client.admin().cluster().execute(GetLicenseAction.INSTANCE, new GetLicenseRequest(), new RestBuilderListener<GetLicenseResponse>(channel) {
|
GetLicenseRequest getLicenseRequest = new GetLicenseRequest();
|
||||||
|
getLicenseRequest.local(request.paramAsBoolean("local", getLicenseRequest.local()));
|
||||||
|
client.admin().cluster().execute(GetLicenseAction.INSTANCE, getLicenseRequest, new RestBuilderListener<GetLicenseResponse>(channel) {
|
||||||
@Override
|
@Override
|
||||||
public RestResponse buildResponse(GetLicenseResponse response, XContentBuilder builder) throws Exception {
|
public RestResponse buildResponse(GetLicenseResponse response, XContentBuilder builder) throws Exception {
|
||||||
ESLicenses.toXContent(response.licenses(), builder, params);
|
ESLicenses.toXContent(response.licenses(), builder, params);
|
||||||
|
|
Loading…
Reference in New Issue