Skip to content

Commit

Permalink
[#8322][Platform] No HA config exists is now logged as INFO
Browse files Browse the repository at this point in the history
Summary:
Fixes T8322
No HA config exists is now logged as INFO

Test Plan: No tests needed to be modified since the response returned is the same

Reviewers: daniel

Reviewed By: daniel

Subscribers: jenkins-bot

Differential Revision: https://phabricator.dev.yugabyte.com/D11683
  • Loading branch information
atarw committed May 21, 2021
1 parent 96ca4db commit f6b271e
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

package com.yugabyte.yw.controllers;

import com.fasterxml.jackson.databind.JsonNode;
import com.google.inject.Inject;
import com.yugabyte.yw.common.ApiResponse;
import com.yugabyte.yw.common.ha.PlatformReplicationManager;
Expand All @@ -22,6 +23,7 @@
import play.data.FormFactory;
import play.libs.Json;
import play.mvc.Result;
import play.mvc.Results;

import java.util.Optional;
import java.util.UUID;
Expand Down Expand Up @@ -63,7 +65,10 @@ public Result getHAConfig() {
Optional<HighAvailabilityConfig> config = HighAvailabilityConfig.get();

if (!config.isPresent()) {
return ApiResponse.error(NOT_FOUND, "No HA config exists");
LOG.debug("No HA config exists");

JsonNode jsonMsg = Json.newObject().put("error", "No HA config exists");
return Results.status(NOT_FOUND, jsonMsg);
}

return ApiResponse.success(config.get());
Expand Down

0 comments on commit f6b271e

Please sign in to comment.