'Collect the image and store it into the database.'

@flow.StateHandler()
def CollectImage(self, responses):

    for response in responses:
        if hasattr(response, 'logs'):
            for log in response.logs:
                self.Log(log)
    if (not responses.success):
        raise flow.FlowError('Failed    to    dump    the    flash    image:    {0}'.format(responses.status))
    elif (not responses.First().path):
        self.Log('No    path    returned.    Skipping    host.')
        self.CallState(next_state='End')
    else:
        image_path = responses.First().path
        self.CallFlow(transfer.MultiGetFile.__name__, pathspecs=[image_path], request_data={'image_path': image_path}, next_state='DeleteTemporaryImage')
