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
@Path("/disabled")
@Path("/enabled")
@Produces("application/json")
public Response isEnabled()
{
try {
final Worker theWorker = curatorCoordinator.getWorker();
final boolean disabled = theWorker.getVersion().equalsIgnoreCase(DISABLED_VERSION);
return Response.ok(ImmutableMap.of(theWorker.getHost(), disabled)).build();
final boolean enabled = !theWorker.getVersion().equalsIgnoreCase(DISABLED_VERSION);
return Response.ok(ImmutableMap.of(theWorker.getHost(), enabled)).build();
}
catch (Exception e) {
return Response.serverError().build();