Add some better logging to the ancestry audit.

This commit is contained in:
jakedt 2014-02-21 13:56:14 -05:00
parent 177a21e996
commit 3cef327980

View file

@ -59,10 +59,12 @@ def resolve_or_create(repo, docker_image_id, new_ancestry):
logger.debug('Created image: %s' % created)
return created
except ImageStorage.DoesNotExist:
logger.warning('No storage for ancestor, tring to find it anywhere!')
logger.warning('No storage for ancestor, tring to find it anywhere: %s',
docker_image_id)
try:
found = Image.get(docker_image_id=docker_image_id)
logger.debug('Found some legacy storage')
logger.debug('Found some legacy storage for docker_image_id: %s',
docker_image_id)
new_storage = ImageStorage.create(checksum=found.checksum,
created=found.created,
comment=found.comment,
@ -90,8 +92,9 @@ def resolve_or_create(repo, docker_image_id, new_ancestry):
return created
except Image.DoesNotExist:
logger.error('No image available anywhere for storage.')
raise RuntimeError('No image available anywhere for storage.')
msg = 'No image available anywhere for storage: %s in namespace: %s'
logger.error(msg, docker_image_id, repo.namespace)
raise RuntimeError()
cant_fix = []