djeuscan: pkg.metadata can fail

Signed-off-by: Corentin Chary <corentin.chary@gmail.com>
This commit is contained in:
Corentin Chary 2012-07-26 21:18:31 +02:00
parent 3c30cae6eb
commit 89408dde2b

View File

@ -49,8 +49,14 @@ class ScanMetadata(object):
if created: if created:
self.logger.info('+ [p] %s/%s' % (pkg.category, pkg.name)) self.logger.info('+ [p] %s/%s' % (pkg.category, pkg.name))
try:
if not pkg.metadata: if not pkg.metadata:
return return
except Exception as e:
self.logger.error(
self.style.ERROR('%s/%s: %s' % (pkg.category, pkg.name, str(e)))
)
return
herds = dict( herds = dict(
[(herd[0], herd) for herd in pkg.metadata.herds(True)] [(herd[0], herd) for herd in pkg.metadata.herds(True)]