import_layers: tweak debug logging to be a bit more useful

* Drop most "Skipping..." messages
* Use layerbranch name instead of ID

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
This commit is contained in:
Paul Eggleton 2019-09-20 09:33:01 +12:00
parent 16734d7082
commit f78fd0707c

View File

@ -138,7 +138,7 @@ def main():
exclude_fields = ['id', 'updated'] exclude_fields = ['id', 'updated']
for layerjs in jsdata: for layerjs in jsdata:
if layer_re and not layer_re.match(layerjs['name']): if layer_re and not layer_re.match(layerjs['name']):
logger.debug('Skipping layer %s, does not match layer restriction' % layerjs['name']) #logger.debug('Skipping layer %s, does not match layer restriction' % layerjs['name'])
continue continue
layeritem = LayerItem.objects.filter(name=layerjs['name']).first() layeritem = LayerItem.objects.filter(name=layerjs['name']).first()
@ -288,7 +288,7 @@ def main():
for filedep in filedeps: for filedep in filedeps:
target_layerbranch = layerbranch_idmap.get(filedep['layerbranch'], None) target_layerbranch = layerbranch_idmap.get(filedep['layerbranch'], None)
if target_layerbranch is None: if target_layerbranch is None:
logger.debug('Skipping recipe file dependency on layerbranch %s, branch not imported' % filedep['layerbranch']) #logger.debug('Skipping recipe file dependency on layerbranch %s, branch not imported' % filedep['layerbranch'])
continue continue
depobj, created = RecipeFileDependency.objects.get_or_create(recipe=recipe, layerbranch=target_layerbranch, path=filedep['path']) depobj, created = RecipeFileDependency.objects.get_or_create(recipe=recipe, layerbranch=target_layerbranch, path=filedep['path'])
if created: if created:
@ -310,12 +310,12 @@ def main():
branch = branch_idmap.get(layerbranchjs['branch'], None) branch = branch_idmap.get(layerbranchjs['branch'], None)
if not branch: if not branch:
# We don't have this branch, skip it # We don't have this branch, skip it
logger.debug('Skipping layerbranch %s, branch not imported' % layerbranchjs['id']) #logger.debug('Skipping layerbranch %s, branch not imported' % layerbranchjs['id'])
continue continue
layer = layer_idmap.get(layerbranchjs['layer'], None) layer = layer_idmap.get(layerbranchjs['layer'], None)
if not layer: if not layer:
# We didn't import this layer, skip it # We didn't import this layer, skip it
logger.debug('Skipping layerbranch %s, layer not imported' % layerbranchjs['id']) #logger.debug('Skipping layerbranch %s, layer not imported' % layerbranchjs['id'])
continue continue
layerbranch = LayerBranch.objects.filter(layer=layer).filter(branch=branch).first() layerbranch = LayerBranch.objects.filter(layer=layer).filter(branch=branch).first()
if layerbranch: if layerbranch:
@ -324,7 +324,7 @@ def main():
# to be able to import layer dependencies) # to be able to import layer dependencies)
existing_layerbranches.remove(layerbranch.id) existing_layerbranches.remove(layerbranch.id)
if layerbranchjs['vcs_last_rev'] == layerbranch.vcs_last_rev and not args.reload: if layerbranchjs['vcs_last_rev'] == layerbranch.vcs_last_rev and not args.reload:
logger.debug('Skipping layerbranch %s, already up-to-date' % layerbranchjs['id']) logger.debug('Skipping layerbranch %s, already up-to-date' % layerbranch)
layerbranch_idmap[layerbranchjs['id']] = layerbranch layerbranch_idmap[layerbranchjs['id']] = layerbranch
continue continue
logger.info('Updating %s (%d/%d)' % (layerbranch, i+1, layercount)) logger.info('Updating %s (%d/%d)' % (layerbranch, i+1, layercount))