Source:
<code>private RollingUpdateTaskResult rollingUpdateAwaitRunning(final DeploymentGroup deploymentGroup, final String host) { final ZooKeeperClient client = provider.get("rollingUpdateAwaitRunning"); final Map<JobId, TaskStatus> taskStatuses = getTaskStatuses(client, host); if (!taskStatuses.containsKey(deploymentGroup.getJobId())) { final Deployment deployment = getDeployment(host, deploymentGroup.getJobId()); if (deployment == null) { <START> return RollingUpdateTaskResult.error("job was manually undeployed"); <END> } if (isRolloutTimedOut(deploymentGroup, client)) { return RollingUpdateTaskResult.error("timed out while retrieving job status"); } return RollingUpdateTaskResult.TASK_IN_PROGRESS; } else if (!taskStatuses.get(deploymentGroup.getJobId()).getState() .equals(TaskStatus.State.RUNNING)) { if (isRolloutTimedOut(deploymentGroup, client)) { return RollingUpdateTaskResult.error("timed out waiting for job to reach RUNNING"); } return RollingUpdateTaskResult.TASK_IN_PROGRESS; } else { final Deployment deployment = getDeployment(host, deploymentGroup.getJobId()); if (deployment == null) { return RollingUpdateTaskResult.error("deployment for this job not found in zookeeper"); } else if (!Objects.equals(deployment.getDeploymentGroupName(), deploymentGroup.getName())) { return RollingUpdateTaskResult.error("job was already deployed, either manually or by a " + "different deployment group"); } return RollingUpdateTaskResult.TASK_COMPLETE; } }</code><technical_language>fringe cases "manual" part of this statement is true. E.g. if created overlapping deployment group rolling-update --migrate flag. lines of: "Job unexpectedly undeployed host %s. undeployed manually?"</technical_language>

Target:
private RollingUpdateTaskResult rollingUpdateAwaitRunning(final DeploymentGroup deploymentGroup, final String host) { final ZooKeeperClient client = provider.get("rollingUpdateAwaitRunning"); final Map<JobId, TaskStatus> taskStatuses = getTaskStatuses(client, host); if (!taskStatuses.containsKey(deploymentGroup.getJobId())) { final Deployment deployment = getDeployment(host, deploymentGroup.getJobId()); if (deployment == null) { return RollingUpdateTaskResult.error( "Job unexpectedly undeployed. Perhaps it was manually undeployed?"); } if (isRolloutTimedOut(deploymentGroup, client)) { return RollingUpdateTaskResult.error("timed out while retrieving job status"); } return RollingUpdateTaskResult.TASK_IN_PROGRESS; } else if (!taskStatuses.get(deploymentGroup.getJobId()).getState() .equals(TaskStatus.State.RUNNING)) { if (isRolloutTimedOut(deploymentGroup, client)) { return RollingUpdateTaskResult.error("timed out waiting for job to reach RUNNING"); } return RollingUpdateTaskResult.TASK_IN_PROGRESS; } else { final Deployment deployment = getDeployment(host, deploymentGroup.getJobId()); if (deployment == null) { return RollingUpdateTaskResult.error( "deployment for this job not found in zookeeper. Perhaps it was manually undeployed?"); } else if (!Objects.equals(deployment.getDeploymentGroupName(), deploymentGroup.getName())) { return RollingUpdateTaskResult.error("job was already deployed, either manually or by a " + "different deployment group"); } return RollingUpdateTaskResult.TASK_COMPLETE; } }