fix enabled endpoint

This commit is contained in:
fjy 2014-07-17 18:04:36 -07:00
parent 83cb7931ac
commit beac0be45b
1 changed files with 3 additions and 3 deletions

View File

@ -99,14 +99,14 @@ public class WorkerResource
} }
@GET @GET
@Path("/disabled") @Path("/enabled")
@Produces("application/json") @Produces("application/json")
public Response isEnabled() public Response isEnabled()
{ {
try { try {
final Worker theWorker = curatorCoordinator.getWorker(); final Worker theWorker = curatorCoordinator.getWorker();
final boolean disabled = theWorker.getVersion().equalsIgnoreCase(DISABLED_VERSION); final boolean enabled = !theWorker.getVersion().equalsIgnoreCase(DISABLED_VERSION);
return Response.ok(ImmutableMap.of(theWorker.getHost(), disabled)).build(); return Response.ok(ImmutableMap.of(theWorker.getHost(), enabled)).build();
} }
catch (Exception e) { catch (Exception e) {
return Response.serverError().build(); return Response.serverError().build();