Skip to content

Commit

Permalink
Fix live execution if no previous sboms are given
Browse files Browse the repository at this point in the history
context_layers was used without being assigned anything in the
case when only one layer was present. To fix this, we assign the
variable final_layer to the one layer we had created and only
popped the final layer in the case when previous sboms were given.

Signed-off-by: Nisha K <nishak@vmware.com>
  • Loading branch information
Nisha K authored and rnjudge committed Jul 8, 2021
1 parent 20573c4 commit 273e3c8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tern/analyze/default/live/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,9 @@ def execute_live(args):
# resolve the packages for each of the layers
context_layers.append(layer)
resolve_context_packages(context_layers)
final_layer = context_layers.pop()
else:
final_layer = layer
# report out the packages
final_layer = context_layers.pop()
logger.debug("Preparing report")
report.report_layer(final_layer, args)

0 comments on commit 273e3c8

Please sign in to comment.