security: Get the list of packages from Packages component

Instead of from managed_packages module level variable.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
Sunil Mohan Adapa 2021-11-16 08:13:37 -08:00 committed by James Valleroy
parent cea023f7b2
commit 6ba98573d5
No known key found for this signature in database
GPG Key ID: 77C0C75E7B650808

View File

@ -131,9 +131,12 @@ def get_apps_report():
}
}
for module_name, module in module_loader.loaded_modules.items():
try:
packages = module.managed_packages
except AttributeError:
components = module.app.get_components_of_type(Packages)
packages = []
for component in components:
packages += component.packages
if not packages:
continue # app has no managed packages
try: