ImagingBackendService.java (eucalyptus-4.4.1) | : | ImagingBackendService.java (eucalyptus-4.4.2) | ||
---|---|---|---|---|
skipping to change at line 68 | skipping to change at line 68 | |||
throw new ImagingServiceException( ImagingServiceException.DEFAULT_CODE, "Not authorized to put import task status." ); | throw new ImagingServiceException( ImagingServiceException.DEFAULT_CODE, "Not authorized to put import task status." ); | |||
} | } | |||
}catch(final ImagingServiceException ex){ | }catch(final ImagingServiceException ex){ | |||
throw ex; | throw ex; | |||
}catch(final Exception ex){ | }catch(final Exception ex){ | |||
throw new ImagingServiceException( ImagingServiceException.DEFAULT_CODE, " Not authorized to put import task status." ); | throw new ImagingServiceException( ImagingServiceException.DEFAULT_CODE, " Not authorized to put import task status." ); | |||
} | } | |||
try{ | try{ | |||
final String remoteHost = request.getSourceIp(); | final String remoteHost = request.getSourceIp(); | |||
ImagingWorkers.verifyWorker(request.getInstanceId(), remoteHost); | ImagingWorkers.verifyWorker(request.getInstanceId(), remoteHost); | |||
}catch(final Exception ex){ | }catch(final ImagingWorkers.ImagingWorkerVerifyException ex){ | |||
LOG.warn("Failed to verify worker", ex); | LOG.warn(ex.getMessage( ), ex.getCause( )); | |||
throw new ImagingServiceException(ImagingServiceException.DEFAULT_CODE, "N ot authorized to put import task status." ); | throw new ImagingServiceException(ImagingServiceException.DEFAULT_CODE, "N ot authorized to put import task status." ); | |||
} | } | |||
reply.setCancelled(false); | reply.setCancelled(false); | |||
try{ | try{ | |||
final String taskId = request.getImportTaskId(); | final String taskId = request.getImportTaskId(); | |||
final String volumeId = request.getVolumeId(); | final String volumeId = request.getVolumeId(); | |||
if(taskId==null) | if(taskId==null) | |||
throw new Exception("Task id is null"); | throw new Exception("Task id is null"); | |||
ImagingTask imagingTask = null; | ImagingTask imagingTask = null; | |||
skipping to change at line 200 | skipping to change at line 200 | |||
} | } | |||
}catch(final ImagingServiceException ex){ | }catch(final ImagingServiceException ex){ | |||
throw ex; | throw ex; | |||
}catch(final Exception ex){ | }catch(final Exception ex){ | |||
throw new ImagingServiceException( ImagingServiceException.DEFAULT_CODE, " Not authorized to get import task." ); | throw new ImagingServiceException( ImagingServiceException.DEFAULT_CODE, " Not authorized to get import task." ); | |||
} | } | |||
try{ | try{ | |||
final String remoteHost = request.getSourceIp(); | final String remoteHost = request.getSourceIp(); | |||
ImagingWorkers.verifyWorker(request.getInstanceId(), remoteHost); | ImagingWorkers.verifyWorker(request.getInstanceId(), remoteHost); | |||
}catch(final Exception ex){ | }catch(final ImagingWorkers.ImagingWorkerVerifyException ex){ | |||
LOG.warn("Failed to verify worker", ex); | LOG.warn(ex.getMessage( ), ex.getCause( )); | |||
throw new ImagingServiceException(ImagingServiceException.DEFAULT_CODE, "N ot authorized to get instance import task." ); | throw new ImagingServiceException(ImagingServiceException.DEFAULT_CODE, "N ot authorized to get instance import task." ); | |||
} | } | |||
try{ | try{ | |||
ImagingWorker worker = ImagingWorkers.getWorker(request.getInstanceId()); | ImagingWorker worker = ImagingWorkers.getWorker(request.getInstanceId()); | |||
if(worker!=null) { | if(worker!=null) { | |||
ImagingWorkers.markUpdate(request.getInstanceId()); | ImagingWorkers.markUpdate(request.getInstanceId()); | |||
if(!ImagingWorkers.canAllocate(request.getInstanceId())){ | if(!ImagingWorkers.canAllocate(request.getInstanceId())){ | |||
LOG.warn(String.format("The worker (%s) is marked invalid", request.ge tInstanceId())); | LOG.warn(String.format("The worker (%s) is marked invalid", request.ge tInstanceId())); | |||
return reply; | return reply; | |||
End of changes. 2 change blocks. | ||||
4 lines changed or deleted | 4 lines changed or added |