Skip to content

Commit

Permalink
[Backport 2.x] Fix spelling (opensearch-project#4306)
Browse files Browse the repository at this point in the history
Signed-off-by: Andrey Pleskach <[email protected]>
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
  • Loading branch information
1 parent 38132ec commit fae396a
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
import static org.opensearch.security.dlic.rest.api.Responses.conflict;
import static org.opensearch.security.dlic.rest.api.Responses.forbidden;
import static org.opensearch.security.dlic.rest.api.Responses.forbiddenMessage;
import static org.opensearch.security.dlic.rest.api.Responses.internalSeverError;
import static org.opensearch.security.dlic.rest.api.Responses.internalServerError;
import static org.opensearch.security.dlic.rest.api.Responses.payload;
import static org.opensearch.security.dlic.rest.support.Utils.withIOException;

Expand Down Expand Up @@ -482,7 +482,7 @@ public final void onFailure(Exception e) {
if (ExceptionsHelper.unwrapCause(e) instanceof VersionConflictEngineException) {
conflict(channel, e.getMessage());
} else {
internalSeverError(channel, "Error " + e.getMessage());
internalServerError(channel, "Error " + e.getMessage());
}
}

Expand Down Expand Up @@ -579,7 +579,7 @@ protected final RestChannelConsumer prepareRequest(RestRequest request, NodeClie

// check if .opendistro_security index has been initialized
if (!ensureIndexExists()) {
return channel -> internalSeverError(channel, RequestContentValidator.ValidationError.SECURITY_NOT_INITIALIZED.message());
return channel -> internalServerError(channel, RequestContentValidator.ValidationError.SECURITY_NOT_INITIALIZED.message());
}

// check if request is authorized
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
import org.opensearch.security.securityconf.impl.CType;
import org.opensearch.threadpool.ThreadPool;

import static org.opensearch.security.dlic.rest.api.Responses.internalSeverError;
import static org.opensearch.security.dlic.rest.api.Responses.internalServerError;
import static org.opensearch.security.dlic.rest.api.Responses.ok;
import static org.opensearch.security.dlic.rest.support.Utils.addRoutesPrefix;

Expand Down Expand Up @@ -73,7 +73,7 @@ private void flushCacheApiRequestHandlers(RequestHandler.RequestHandlersBuilder
public void onResponse(ConfigUpdateResponse configUpdateResponse) {
if (configUpdateResponse.hasFailures()) {
LOGGER.error("Cannot flush cache due to", configUpdateResponse.failures().get(0));
internalSeverError(
internalServerError(
channel,
"Cannot flush cache due to " + configUpdateResponse.failures().get(0).getMessage() + "."
);
Expand All @@ -86,7 +86,7 @@ public void onResponse(ConfigUpdateResponse configUpdateResponse) {
@Override
public void onFailure(final Exception e) {
LOGGER.error("Cannot flush cache due to", e);
internalSeverError(channel, "Cannot flush cache due to " + e.getMessage() + ".");
internalServerError(channel, "Cannot flush cache due to " + e.getMessage() + ".");
}

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
import org.opensearch.threadpool.ThreadPool;

import static org.opensearch.security.dlic.rest.api.Responses.badRequest;
import static org.opensearch.security.dlic.rest.api.Responses.internalSeverError;
import static org.opensearch.security.dlic.rest.api.Responses.internalServerError;
import static org.opensearch.security.dlic.rest.api.Responses.ok;
import static org.opensearch.security.dlic.rest.support.Utils.addRoutesPrefix;
// CS-ENFORCE-SINGLE
Expand Down Expand Up @@ -218,7 +218,7 @@ public void onResponse(CreateIndexResponse response) {
}
} catch (final IOException e1) {
LOGGER.error("Unable to create bulk request " + e1, e1);
internalSeverError(channel, "Unable to create bulk request.");
internalServerError(channel, "Unable to create bulk request.");
return;
}

Expand All @@ -235,7 +235,7 @@ public void onResponse(BulkResponse response) {
"Unable to upload migrated configuration because of "
+ response.buildFailureMessage()
);
internalSeverError(
internalServerError(
channel,
"Unable to upload migrated configuration (bulk index failed)."
);
Expand All @@ -249,7 +249,7 @@ public void onResponse(BulkResponse response) {
@Override
public void onFailure(Exception e) {
LOGGER.error("Unable to upload migrated configuration because of " + e, e);
internalSeverError(channel, "Unable to upload migrated configuration.");
internalServerError(channel, "Unable to upload migrated configuration.");
}
}
)
Expand All @@ -260,7 +260,7 @@ public void onFailure(Exception e) {
@Override
public void onFailure(Exception e) {
LOGGER.error("Unable to create opendistro_security index because of " + e, e);
internalSeverError(channel, "Unable to create opendistro_security index.");
internalServerError(channel, "Unable to create opendistro_security index.");
}
});

Expand All @@ -272,7 +272,7 @@ public void onFailure(Exception e) {
@Override
public void onFailure(Exception e) {
LOGGER.error("Unable to delete opendistro_security index because of " + e, e);
internalSeverError(channel, "Unable to delete opendistro_security index.");
internalServerError(channel, "Unable to delete opendistro_security index.");
}
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public static void conflict(final RestChannel channel, final String message) {
response(channel, RestStatus.CONFLICT, message);
}

public static void internalSeverError(final RestChannel channel, final String message) {
public static void internalServerError(final RestChannel channel, final String message) {
response(channel, RestStatus.INTERNAL_SERVER_ERROR, message);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
import org.opensearch.threadpool.ThreadPool;

import static org.opensearch.security.dlic.rest.api.Responses.badRequest;
import static org.opensearch.security.dlic.rest.api.Responses.internalSeverError;
import static org.opensearch.security.dlic.rest.api.Responses.internalServerError;
import static org.opensearch.security.dlic.rest.api.Responses.ok;
import static org.opensearch.security.dlic.rest.support.Utils.addRoutesPrefix;

Expand Down Expand Up @@ -125,7 +125,7 @@ protected void validate(RestChannel channel, RestRequest request) throws IOExcep

ok(channel, "OK.");
} catch (Exception e) {
internalSeverError(channel, "Configuration is not valid.");
internalServerError(channel, "Configuration is not valid.");
}
}

Expand Down

0 comments on commit fae396a

Please sign in to comment.